NYCPHP Meetup

NYPHP.org

[nycphp-talk] php.ini question

Scott Mattocks scott at crisscott.com
Thu Sep 2 13:04:13 EDT 2004


Rahmin Pavlovic wrote:

> For example, I reuse the same form for inserts and updates.  I'd grab the values from GET's , POST's or SQL queries, and assign them to local 
> variables like $msg and $email, like:
> 
> <input type="text" name="email" value="<?= $email ?>" />
> 
> However, if the user was arriving for the first time, $email would not be set, and the field would be prefilled with the error notice, as opposed 
> to it just showing up blank (as on the old server).  I'd have to declare $email=''; or $email=(isset($_POST['email']))?trim($_POST['email']):''; to 
> eliminate the notice.

No offense Rahmin, but why not just clean up the code. It will save you 
headaches in the long run and make your code more secure.

> 
> I'm pretty sure error_reporting being set to E_ALL & ~E_NOTICE will fix the problem (it was set to E_ALL before), but I have to wait for the 
> sysadmin to come reboot to find out.

You can set error reporting in an .htaccess file and in your code. You 
shouldn't need a sysadmin for this and you definately shouldn't need a 
reboot (a restart of the webserver maybe but not a reboot).

Scott Mattocks



More information about the talk mailing list