Does anyone know how i could do this as a condiftional statement? I want to set a variable based on the image selected and then pass that variable as a session variable and open a page. All I want is a way to pass a value to a variable when the user clicks one of the image maps. I don't want to use a form with a submit button. Is there any other way to accomplish this?
With what you have, you cannot do this with just php. PHP is pure server side, and you're href is a hash target, so thats all client side. With AJAX you could do this.
However, if you change you're href to include an identifier for the particular image (ie: <area shape="rect" coords="w,x,y,z" href="page.php?image=uniqueVal" />), then you can detect this with the $_GET superglobal on the page.php.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
If i understand correctly, i would use an intermediate page and use the value in image to detect which link was clicked? how would this be possible in ajax?
Correct. The intermediate page could be this page with conditions though, it doesn't technically have to be a new script.
Ajax would simply use the same page to take care of this behind the scenes. You would instead use an onclick event to pass some identifiable information to the page, get the result and do what you need to do with it. W3Schools has a pretty straight forward AJAX tutorial: http://www.w3schools.com/Ajax/Default.Asp
Questions relating to AJAX would go under the javascript subforum for AJAX and Design. You'll need to ensure that the return result is either plain text or well formed xml.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php