On Sat, 2004-11-20 at 00:37, Gautam Sathe wrote: > Hi > > I am new to PHP... Was just playing with the code to see what I can do and I > ran into a weird problem. > > I have this code in a .php file: > ------------snip--------------------------- > Notice: Use of undefined constant display - assumed 'display' in > C:\Inetpub\wwwroot\dcts\includes\sidebar_notes.php on line 28 > > Notice: Use of undefined constant message - assumed 'message' in > C:\Inetpub\wwwroot\includes\sidebar_notes.php on line 28 > None > Notice: Use of undefined constant url - assumed 'url' in > C:\Inetpub\wwwroot\includes\sidebar_notes.php on line 28 > -- > > Why would this throw up such an error message? It seems very strange to > me... Changing file permissions seems to affect this... When I grant all > permissions to everyone I get this error... Otherwise I get a 404.
It is exactly what it says it is, you have not defined them before using them so they are not initialised to any value. You can look this up in the manual. Another good way of investigating error messages if you cannot find anything about them is to put your error message into http://www.google.com/linux I put your "Use of undefined constant" in and the third entry was http://linux.com.hk/PenguinWeb/docs/php/language.constants.html which gives a good explanation. php.ini allows the handling of error messages to be altered. What you have are "notices" rather than errors. It is common for notices not to be shown. I alway set it to E_ALL as it helps me to avoid bad code practices and for development I always have show_errors on so that I can see them in the browser rather than having to look in an error log. I expect you will find that the error settings in php.ini between the two computers are different, which is why they will behave differently. Hope this helps. Chris BTW They are PHP notices rather than IIS errors.