Page 1 of 1
Imagemap and $_GET
Posted: Tue Mar 16, 2004 6:46 pm
by Shendemiar
Can i, and how, use $_get to receive the coordinates submittend my imagemap like
http://www.kana.koira/blaah?123,345
Posted: Tue Mar 16, 2004 7:09 pm
by Goowe
Can you elaborate?
Do you mean that the image map is sectioned off and each part is a link and you want the link to go to the coordinates of that section? Or... do you want the sections to be made based upon the query string (retrieved using $_GET)?
Posted: Tue Mar 16, 2004 7:14 pm
by Shendemiar
I just wanted the coordinates.
I figured it out:
$cords = explode("," , $_SERVER['QUERY_STRING']);
echo "x=".$cords[0];
echo "y=".$cords[1];
Posted: Tue Mar 16, 2004 7:17 pm
by Goowe
Oooo very nice! I was making it much harder than it was.
Posted: Tue Mar 16, 2004 7:19 pm
by m3mn0n
A more simple solution is "page.php?x=50&y=36".
Then simply echo() the two $_GET variables.
Posted: Tue Mar 16, 2004 7:22 pm
by Shendemiar
Sami wrote:A more simple solution is "page.php?x=50&y=36".
Then simply echo() the two $_GET variables.
But how could i make the imagemap to output x=50&y=36 ?
It outputs ?50,36 by default
Posted: Tue Mar 16, 2004 7:51 pm
by Goowe
Your link would be something like...
page.php?x=50&y=36
In your code, you put something like...
echo "x=".$_GET['x']."<BR>\n";
echo "y=".$_GET['y']."<BR>\n";
Posted: Tue Mar 16, 2004 10:56 pm
by m3mn0n
Shendemiar wrote:Sami wrote:A more simple solution is "page.php?x=50&y=36".
Then simply echo() the two $_GET variables.
But how could i make the imagemap to output x=50&y=36 ?
It outputs ?50,36 by default
Oh I see. I thought you where in control of setting up the GET variables.
Indeed your way is best, as long as nothing else is submit within the GET method.

Posted: Wed Mar 17, 2004 6:05 pm
by Shendemiar
Indeed your way is best, as long as nothing else is submit within the GET method.
Indeed, but now i would like to submit something else too.
Is there an easy way to submit various amount of $_GET data and imagemap (format= ?123,234) data at the same time.
Or it wouldnt be difficult but combining that stuff with istantjumping dropdownmenus that point back to itself is too complicated for me.
I would like the page to maintains all the settings and the coordinates even when any of the setting is changed. Maybe i have to drop that and start from clean table after any option change.
NOUP! I got it
I use fake _GET item like cords=* at the last element of the url. Then i allways get cords=*?123,234 and $_GET['cords']=*?123,234
And thats easy to parse...