Zubrag.com
October 14, 2019, 12:12:51 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: 'Notices' in error log  (Read 11882 times)
Eddy_P
Chief Researcher - PPHC Study Group (Australia)
Newbie
*
Posts: 23



WWW
« on: June 10, 2007, 12:16:07 AM »

On my server, my 'error log' has grown to over 13 MB while I have been testing my php pages.

Upon investigation, it contains vast multitudes of "undefined constants" and "undefined variables" notices that are apparently and somehow generated by my php scripts.

I find this strange, as it is said that 'variables in php do not have to be defined' and I am not utilizing any constants in my scripts.

I have no idea what to do Huh

How can I turn off the Notice generating mechanism ?
I do not have access to my server's php config and other files.

Logged

Evidence of TIME TRAVEL presented and examined WORLD BREAKING DISCOVERIES
Eddy_P
Chief Researcher - PPHC Study Group (Australia)
Newbie
*
Posts: 23



WWW
« Reply #1 on: June 10, 2007, 02:37:58 AM »

I have placed the following line at the beginning of all my php pages:

error_reporting(E_ALL ^ E_NOTICE);

The error 'Notices' in the log file seem to have ceased.

I hope I haven't created more problems doing this that are not yet apparent.
Logged

Evidence of TIME TRAVEL presented and examined WORLD BREAKING DISCOVERIES
Eddy_P
Chief Researcher - PPHC Study Group (Australia)
Newbie
*
Posts: 23



WWW
« Reply #2 on: June 10, 2007, 09:39:14 PM »

I spoke too soon.

Still getting 'Undefined variable' and 'Undefined constant' notices, and now a 'Undefined index' notices.

Huh?
Logged

Evidence of TIME TRAVEL presented and examined WORLD BREAKING DISCOVERIES
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #3 on: June 11, 2007, 04:49:57 AM »

Undefined index error is most likely produced when script tries to access non-existing array element.

Sometimes programmers forget to add dollar sign before variable, and php treats it as "undefined constant".

It is hard to say what exactly generates these notices without looking into source code of your php scripts.

Most likely your scripts access array elements like this

echo $arrayname[green];

while correct syntax would be (notice quotes)

echo $arrayname['green'];

Accessing named array elements without quotes would produce "Undefined constant" notice (while it will still work as expected).
Logged
Eddy_P
Chief Researcher - PPHC Study Group (Australia)
Newbie
*
Posts: 23



WWW
« Reply #4 on: June 11, 2007, 06:00:07 AM »

$v_name = $_POST[v_name];

I have changed this to $v_name = $_POST['v_name'];

All seemed well - until...
Now getting "parse error T_CONSTANT_ENCAPSED_STRING"

Huh
Logged

Evidence of TIME TRAVEL presented and examined WORLD BREAKING DISCOVERIES
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #5 on: June 11, 2007, 07:35:46 AM »

It should also point the erroneous line. Like error ...... in line 123.   What code you have in that line?
Logged
Eddy_P
Chief Researcher - PPHC Study Group (Australia)
Newbie
*
Posts: 23



WWW
« Reply #6 on: June 11, 2007, 08:08:21 AM »

Similar to this...
PHP Parse error:  parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/vhosts/domain_path/file-name.php on line 3, referer: http://www.domain_path/other_file.php

Line 3 in "other_file.php" is where it requires "file_name.php".
Thus the originating error/problem has to be in "file_name.php" - yes ?

Many of the variables 'IF TRUE' are book titles, in capital letters. (But if false = "")
Also, a $country can be either " " or "name in CAPITALS" and is captured from the previous page by $country = $_POST['country'];.

Thank you for your time,
Eddy
Logged

Evidence of TIME TRAVEL presented and examined WORLD BREAKING DISCOVERIES
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC