Answered
passing data in url, what happens if no data is passed
I am working in php with MySQL.
Some of the pages in my site require some data to be passed in the url. In most cases it is 'data_region'. If this isn't passed in the url I get an 'undefined index' error. Is there a way to say:
if 'data_region' exists use the information that it passes,
else use '?data_region=ALL'
At the moment I am just using a web forwarder on the index page to forward to the main.php with the correct data_region instead of having main.php as the index. This is OK but it sometimes takes a while, especially on slower connections.
Any help appreciated.
My code:

Some of the pages in my site require some data to be passed in the url. In most cases it is 'data_region'. If this isn't passed in the url I get an 'undefined index' error. Is there a way to say:
if 'data_region' exists use the information that it passes,
else use '?data_region=ALL'
At the moment I am just using a web forwarder on the index page to forward to the main.php with the correct data_region instead of having main.php as the index. This is OK but it sometimes takes a while, especially on slower connections.
Any help appreciated.
My code:
