FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: mackass on October 22, 2005, 03:26:19 AM

Title: PHP errors appearing out of nowhere?
Post by: mackass on October 22, 2005, 03:26:19 AM
I have errors appearing all over my site. I've not made any changes to my coding, they've been untouched for a couple of months and as of today, these errors appear:

Notice: Undefined variable: fieldname in /home/httpd/vhosts/mydomain.com/httpdocs/site.php on line 447
Notice: Undefined variable: fieldemail in /home/httpd/vhosts/mydomain.com/httpdocs/site.php on line 450
Notice: Undefined variable: fieldmessage in /home/httpd/vhosts/mydomain.com/httpdocs/site.php on line 455
Notice: Undefined variable: step in /home/httpd/vhosts/mydomain.com/httpdocs/site.php on line 471

Does anyone know why they've suddenly appeared? Or is it something to do with the servers at the moment?
Title: Re: PHP errors appearing out of nowhere?
Post by: brainiac744 on October 22, 2005, 12:37:23 PM
Notice errors are basically there to show you all the imperfections in your coding, but they don't actually stop the script from working. I assume you put in that line of code gordon gave for the .htaccess file, which seems to show all errors, including E_NOTICE. You can manually set the error level in your PHP files with error_reporting(), the one that you want would probably be error_reporting(E_ALL ^ E_NOTICE); (it reports all errors except e_notice) just put this at the top of the php file that's giving you trouble.  :)
Title: Re: PHP errors appearing out of nowhere?
Post by: webzone (archived) on October 22, 2005, 12:49:36 PM
or you could simply create a .htaccess file in /httpdocs and add this line to its content

php_value error_reporting 2039
Title: Re: PHP errors appearing out of nowhere?
Post by: mackass on October 22, 2005, 06:57:48 PM
Ah, thanks very much guys. :)
Title: Re: PHP errors appearing out of nowhere?
Post by: ghost on October 22, 2005, 09:44:25 PM
lol, I got those too. ALOT of them.. probably 30-40 per page.. but I noticed they didn't stop the pages from working so I just took the .htaccess thing off my site because I had already fixed the problem with my other script :P
Title: Re: PHP errors appearing out of nowhere?
Post by: admin on October 22, 2005, 10:53:50 PM
These "Notices" occur because you have told PHP to show "All Errors".  (All Errors includes notices)

Thank you,
FreePgs.com Admin