I recently installed the WAMP server package on my computer at work. When I first started messing around with PHP(not too long ago), I installed PHP, MySQL, and Apache manually. Well, the application I have been working on is now giving me a WHOLE BUNCH of Notice messages:
Notice: Undefined index: lookatLon in C:\wamp\www\coordinates.php on line 3
Well, as it turns out, I have learned that I am handling my assigning of $variable = $_REQUEST['whatever']; all wrong. For example... I have a script that accepts a $longitude and $latitude from a $_GET['longitude']; and $_GET['latitude'] .... but under certain circumstances, the page is loaded without any 'longitude=' or 'latitude=' in the url.
Now I am getting these notices that it isn't liking my unset variables.
So, my question is, what is the proper way to handle a situation, where sometimes there is GET or POST information available and sometimes there isn't. I just read that it is not a good idea to shut off the notices(which would surely fix my problem), but rather the solution is to code properly.
So what is the proper way to account for GET or POST data that may or may not be there, depending on the situation?