Jump to content


Photo

[Resolved] Using PHP in an ISMAP?


  • Please log in to reply
3 replies to this topic

#1 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 24 October 2006 - 05:49 PM

Ok, what I'm trying to do is if a user clicks on a certain part of the image using the ismap then it would echo off something or like set a cookie for authorization or suttin

<a href=/php>
<img src=image.png ismap border=0>
</a>
<?php
$thing = $_GET['/'];
if($thing == "34,192"){
echo "noob";
};
?>

neoblob.com/php

just go there if you dunno what i mean

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 October 2006 - 06:10 PM

<a href='#'>
<img src='image.png' ismap border=0>
</a>
<?php
  if (count($_GET)) {
    $coords = array_keys($_GET);
    $coords = explode(',', $coords[0]);
    $x = $coords[0];
    $y = $coords[1];
    echo "x co-ord = $x, y co-ord = $y";
  }
?>


#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 October 2006 - 06:13 PM

Elaberating a little. To have something happen when certain co-ords are triggered. eg;

if ($x == 34 && $y ==192) {
  // do whatever.
}


#4 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 24 October 2006 - 06:37 PM

works, thanks ^^




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users