What's better, isset or not?
Is there any speed difference between if (isset($_POST['var'])) or if ($_POST['var']) And which is better or are they the same? ...
Is there any speed difference between if (isset($_POST['var'])) or if ($_POST['var']) And which is better or are they the same? ...
hello guys, am working on a project with zend framework and i need your advise on the right way to fetch data from the database. Am making use of Zend_Layout to load my template. The appropriate view is then loaded into the template. On the template, there is supposed to be a section that displays data from the database (e.g Categori...
hi. im developing a cms. the Table clients contains many fields and one of them is the image caption. When the user uploads a file(image) the file is stored in a public folder. The image caption field retrieves the final name of the file and stores it in the table. The problem is when the user wants to update the information. If the...
Array ( [kanye] => Array ( [0] => Kanya [1] => Janaye [2] => Kayne [3] => Kane [4] => Kaye ) [wst] => Array ( [0] => ST [1] => St [2] => st [3] => EST [4] => West ) ) Array ( [0] => Kanya [1] => Janaye [2] => Kayne [3] => Kane [4] => Kaye ) Array ( [0] => ST [1] => St [2] => st [3] => EST [4] => W...
I have several option that a user can have, mainly to validate his presence around the site. Tables are like this: Users: id=1 username=stackoverflow password=oSKAJMMS; address=xyz ... Options: user_id=1 option=AD3 user_id=1 option=AC1 At some point I need to check if he has a particular option (like: AD3, AC1 etc) in the "op...
I've used two PHP email scripts and routing it through my SMTP server, when I do this though it sends two of the same email. When I use mail() this doesn't happen, but I'd much rather use SMTP. Any ideas why this may be occuring? ...
How can I access a static variable in a separate class in PHP? Is the scope resolution operator the wrong tool for the job? Example: class DB { static $conn = 'Connection'; } class User { function __construct() { DB::conn; //throws "Undefined class constant 'conn' error. } } ...
I have a forcycle that contains a condition (and an incremental value i): if(condition)){$arr[$i] = array("value" => $node->nodeValue));} else{$arr[$i] = array("string" => $node->nodeValue);} In the end I need to have an array like this: Array ( [1] => Array ( [string] => abc [value] => 0,999 ) [2] => Array ( [string...
Is there a list of major OpenID providers URIs that ZF knows how to work with? ...
I have been assigned to add a forum into an in-house CMS we have been using for some time. The system has its own login/user system and an established user database. Ideally I'd be looking for the easiest forum software to convert to use with our system, but if necassary can rewrite and migrate the user databases to use the forums syst...
I need to generate reports in my PHP website (in zend framework) Formats required: PDF (with tables & images) // presently using Zend_Pdf XLS (with tables & images) DOC (with tables & images) CSV (only tables) Please recommend robust and fast solution for generating reports in PHP. Platform: Zend Framework on LAMP I know there are ...
I am new to object oriented programming and writing some of my first classes for a PHP application. In some of the simpler classes, I declare a function __construct(), and inside of that function, call certain class methods. In some cases, I find myself instantiating the class in my app, and not needing to do anything with the resultant...
I migrated my website from PHP 4.4 to PHP 5.2 The error_reporting level in both cases is E_ALL. On PHP 4 the site was working fine but after migrating to PHP 5 i found that one page is throwing error. Cannot redeclare ClassName:varName I found that the variable was indeed re declared in the file. I want to know that why it was working in...
I just installed Apache 2.2.11 and downloaded the zip for PHP5.2.9-2 I uncommented extension=php_pdo_pgsql.dll and extension=php_pgsql.dll But when I call the phpinfo() function, postgresql is not showing up. What am I forgetting? Also, on the PHP site, I found this: In order to enable PostgreSQL support, --with-pgs...
Someone remind me why "." is not used as the namespace separator? I don't think the "." character is used anywhere else in PHP at all, unless I am mistaken. ...
I got a problem with ip2long in PHP5. It appears, that in 32bit OS ip2long returns signed int, and in 64bit OS unsigned int is returned. My application is working on 10 servers, and some are 32bit and some are 64bit, so I need all them to work same way. In PHP documentation there is a trick to make that result always unsigned, but since ...
I'm creating table for defining an individual's BMI. The chart (as yet) doesn't take input (because I want to make the thing work stand-alone, first), but it does show (on parallel axes) the height in both metres and feet/inches. In order to do this I'm defining the metres' start point and range and then converting the defined metres va...
array(1) { [0]=> string(8) "outgoing" } bool(false) array(1) { [0]=> string(8) "outgoing" } bool(false) Is currently being produced by $connect = ftp_connect('example.com'); $result = ftp_login($connect, 'username', 'password'); echo '<pre>'; var_dump(ftp_nlist($connect, '')); var_dump(ftp_nlist($connect, '/outgoing/')...
Hello all, Here is my situation: I have a PHP base class that looks something like this: class Table { static $table_name = "table"; public function selectAllSQL(){ return "SELECT * FROM " . self::$table_name; } } And a subclass that is like this: class MyTable extends Table { static $table_name = "my_table"; } Unfort...
Hello guys, I've started working on integrated Facebook Connect with my app. I have a slight lack of knowledge problem though. I can perfectly make it so you log into Facebook Connect on my site, etc, shows your details all FB Connect functions work. But, how do I make it so I can store the facebook user ID into my MySQL database as pa...