Re: [PHP] Newbie dummy questions..... error messages
> I get the following on one of my pages, > > Warning: Use of undefined constant month - assumed 'month' in > > This site ran error free before, only after adding "Phorum" > > if ($brand == 'nut') { > > if (isset($brand)) { > if ($brand == 'nut') { > $item = "Chris King 2nut Headset"; > } > } Maybe easier to type: if (isset($brand) && $brand == 'nut'){ $item = "Chris King 2nut Headset"; } Phorum must be altering your error_reporting() and not setting it back to its original value. Bad! You can suppress those messages using error_reporting(7) right after you include the Phorum stuff. [7? It used to be 7. Now there's a whole bunch more flags, and I dunno what the numbers mean any more...] Maybe error_reporting(E_ALL^E_NOTICE) or something like that... Anyway, read up on error_reporting. You may find that it's better, though, to change your php.ini file and get these warnings all over the place -- You'll find typos in your variable names easier, for one thing. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Newbie dummy questions..... error messages
I get the following on one of my pages, Warning: Use of undefined constant month - assumed 'month' in /usr/local/etc/httpd/vhosts/eastcoastbicycles.com/htdocs/index.php on line 121 Warning: Use of undefined constant mday - assumed 'mday' in /usr/local/etc/httpd/vhosts/eastcoastbicycles.com/htdocs/index.php on line 122 Warning: Use of undefined constant year - assumed 'year' in /usr/local/etc/httpd/vhosts/eastcoastbicycles.com/htdocs/index.php on line 123 and the offending lines are; $month = $today[month]; $mday = $today[mday]; $year = $today[year]; So I change them to; $month = $today['month']; $mday = $today['mday']; $year = $today['year']; and the problem goes away... simple enough I suppose but what baffles me is. This site ran error free before, only after adding "Phorum" (anyone familiar with it?) do the original pages start to return these errors. Even more strange is they only return these error if one of the "phorum" pages is the referring page. I was also getting a lot of stuff like 'undefined variable' when doing; if ($brand == 'nut') { $item = "Chris King 2nut Headset"; } So I changed it to; if (isset($brand)) { if ($brand == 'nut') { $item = "Chris King 2nut Headset"; } } and it's fine, but again, I'd only get the error if one of the "phorum" pages was the referring page. Any thoughts/insight, anyone? BSDI BSD/OS 4.0.1 PHP Version 4.0B2 Zend Engine v0.90 -Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]