Click to See Complete Forum and Search --> : Position (x,y) of the click on one image
chelson
03-13-2006, 07:53 AM
Hi,
I use this html tag <input type="image" name="couleur" src="images/im.png" /> to get the position of the click on the image.
With the GET method in my form, I can see the result ...couleur.x=93?couleur.y=12... in the URL but the script cannot see these variables as set i.e. this line is never true :
if (isset($_REQUEST['couleur.x']) and isset($_REQUEST['couleur.y']))
I also mention that the treatment script is in the same page as the form, maybe it is a matter of refresh ?!
You can see the whole page here :
http://christophe.helson.free.fr/grafiti.php5
chazzy
03-13-2006, 08:20 AM
do these print out anything in your code, outside of the if:
echo $_GET['couleur.x'];
echo "<br />";
echo $_GET['couleur.y'];
Also check that the $_REQUEST array is defined, depending on what's in php.ini
chelson
03-13-2006, 08:36 AM
The $_GET lines do not print anything in the code.
I did not find the $_REQUEST settings in the php.ini but I don't think that's the problem because this array works in the same script with other indexes.
I tried with the POST method as well but still doesn't work.
chazzy
03-13-2006, 09:04 AM
It seems you have other issues as well
Warning: session_start() [function.session-start]: open(/var/www/free.fr/0/0/christophe.helson/sessions/sess_368ffe80a1d19ad46a98d4d2e20ff5be, O_RDWR) failed: No such file or directory (2) in /var/www/free.fr/0/0/christophe.helson/grafiti.php5 on line 2
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/free.fr/0/0/christophe.helson/grafiti.php5:2) in /var/www/free.fr/0/0/christophe.helson/grafiti.php5 on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/free.fr/0/0/christophe.helson/grafiti.php5:2) in /var/www/free.fr/0/0/christophe.helson/grafiti.php5 on line 2
But post more of your code, there's got to be something else going on here that's not running that part of your script.
chelson
03-14-2006, 03:08 AM
I got it !
I made a print_r with the $_REQUEST array and surprisingly it printed :
couleur_x=110;
couleur_y=28;
whereas in the address bar there is a point between couleur and x.
:confused: Weird but it works !
Now I have to check whats going on with the sessions but thats another problem...