Forum Moderators: coopster

Message Too Old, No Replies

PHP Error log created but there are no errors

         

Pico_Train

12:33 pm on Apr 15, 2008 (gmt 0)

10+ Year Member



Hello there!

This is the story of my setup and the problem:

Using Savant2 Templating
PHP file assigns and displays in a tpl.php file
Using htaccess to rewrite urls so there are no $_GET variables in it but rather site/folder/location/name/ with location and name being the $_GET variables I am using in mysql to retrieve results from the DB.

Now when I go to a page, I am getting errors listed in my error_log except that after looking at the source code of the generated page, the logic in my php file and the echoing out in my tpl.php file, there are no errors? Everything that is there, is there!

Sooooo, what's going on here? Is the php running too quick for mysql? Is php trying to do what I tell it to do with my results array before mysql has returned a result? Is it the .htaccess throwing me a curve ball?

Should I even worry?

[edited by: Pico_Train at 12:34 pm (utc) on April 15, 2008]

jatar_k

1:24 pm on Apr 15, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what errors are you getting in the log?

Pico_Train

1:55 pm on Apr 15, 2008 (gmt 0)

10+ Year Member



[15-Apr-2008 06:45:18] PHP Notice: Undefined index: name in /home/user/public_html/site/templates/location.tpl.php on line 3
[15-Apr-2008 06:45:18] PHP Notice: Undefined index: name in /home/user/public_html/site/templates/location.tpl.php on line 4
[15-Apr-2008 06:45:18] PHP Notice: Undefined index: name in /home/user/public_html/site/templates/location.tpl.php on line 5
[15-Apr-2008 06:45:18] PHP Notice: Undefined index: name in /home/user/public_html/site/templates/location.tpl.php on line 32

I've checked them, the index name is echoed in line 3, the <title>, the name is a place and it's there alright!

That's one set, then I get all sorts where it says the index ['id'] in $array doesn't exist either which is not true because I use it in a mysql function where id = $array['id'] and the function runs and returns results and all that jazz so I am stumped!

[edited by: Pico_Train at 1:58 pm (utc) on April 15, 2008]

coopster

12:39 am on Apr 16, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I've checked them, the index name is echoed in line 3, the <title>, the name is a place and it's there alright!

It may be the case that your templating system is using output buffering and you are attempting to use the index before it is defined and it is getting parsed later on in your code? Did that make sense?

Pico_Train

6:59 am on Apr 16, 2008 (gmt 0)

10+ Year Member



Yeah I understand what you mean...then I think I will just monitor them for a while and if there is no serious errors, will just ignore and delete error_log regularly.

Thanks!