|
Posted by Erwin Moller on 06/22/06 14:22
chsadaki@hotmail.com wrote:
> Hello....
>
> I'm working on a page that finds the shortest path between two nodes.
> The problem is when I draw a node on the map(in the administrative
> page) to save it later in a mysql table, the node doesn't appear unless
> I press the refresh button of the borwser...
>
> this is the code that i worte
Hi,
It loos like you are mixing PHP and JS in a bad way.
Look at the HTML-source your PHP produces, especially the onClick-handler.
It is not valid.
>
> function drawNode($drawMode){
>
> $x=$_GET[img_x];
> $y=$_GET[img_y];
> $map=imagecreatefromjpeg("nodedMap.jpg");
> $Black=imagecolorallocate($map,0,0,0);
> $drawMode='';
> imagefilledarc($map,$x,$y,10,10,0,360,$Black,IMG_ARC_PIE);
> imagejpeg($map,"nodedMap.jpg");
> mysql_query("insert into nodeinfo values ('',$x,$y)");
> return ;
> }
>
> and i call this function by this insturction:
>
> <input name="img" type="image" src="nodedMap.JPG" width="569"
> height="290" border="0" onClick="<? drawNode($drawMode); ?> " >
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|