midnight123 Posted September 24, 2007 Share Posted September 24, 2007 Hello.I copied this tutorial: http://www.plus2net.com/php_tutorial/php_image_coordinates.php It works fine on the website but on my computer I get these errors: Notice: Undefined index: foo in C:\Program Files\EasyPHP 2.0b1\www\cord.php on line 3 Notice: Undefined variable: foo_x in C:\Program Files\EasyPHP 2.0b1\www\cord.php on line 5 Notice: Undefined variable: foo_y in C:\Program Files\EasyPHP 2.0b1\www\cord.php on line 7 It doesn't seem to be recognizing the input image "Foo" <html><body> <form action='cord.php' method=post> <input type="image" alt=' Finding coordinates of an image' src="xy-coordinates.jpg" name="foo" id="foo"/> </form> </body></html> <html><body><center>Hello</center><br> <?php $foo=$_POST["foo"]; echo($foo_x); echo("<br>"); echo($foo_y); ?> </body></html> Does Anybody know what the problem is? Link to comment https://forums.phpfreaks.com/topic/70429-finding-out-image-click-co-ordinates-problem/ Share on other sites More sharing options...
tippy_102 Posted September 24, 2007 Share Posted September 24, 2007 Try this echo $_POST['foo_x']; Link to comment https://forums.phpfreaks.com/topic/70429-finding-out-image-click-co-ordinates-problem/#findComment-353826 Share on other sites More sharing options...
midnight123 Posted September 24, 2007 Author Share Posted September 24, 2007 Hey Thanks a lot.That worked! But on the website tutorial they had <? echo "X=$foo_x, Y=$foo_y "; ?> and it worked for them. Thanks again.This was bothering me all night. Link to comment https://forums.phpfreaks.com/topic/70429-finding-out-image-click-co-ordinates-problem/#findComment-353830 Share on other sites More sharing options...
tippy_102 Posted September 24, 2007 Share Posted September 24, 2007 You have register_globals turned off (which is a good thing), they don't, so the original code works for them. Link to comment https://forums.phpfreaks.com/topic/70429-finding-out-image-click-co-ordinates-problem/#findComment-354419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.