Undefined index error
| From: | Jason Pruim | Date: | Mon, 19 Jan 2009 19:18:13 +0000 |
| Subject: | Undefined index error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-286682@lists.php.net to get a copy of this message | ||
So sometimes I end up with issues that are so simple I should be able to fix it but for some reason I end up asking a stupid question to the list... So... Here goes :)
Here is the error:
Notice: Undefined index: 2 in /home/raosetc/public_html/purl/p.php on line 19
and here is Line 19:
$data = explode("/", $_SERVER['REQUEST_URI']);
When you first hit the site you to go something like: purl.mysupersite.com/YourNameHere
If you went to: purl.mysupersite.com/YourNameHere/ (Notice the trailing /) there would be no error...
Now I know it's just a undefined index error and I can safely ignore it since it works just fine. All I have to do is turn off the error reporting and it's gone... But I want to write good code...
Any Suggestions?
--
Jason Pruim
japruim@raoset.com
616.399.2355