I have a variable inside my php file, which I want to pass to a javascript function whenever the user clicks a link on my php page.
here is the php in brief:
$delete_img=$image_id.'_'.$newfilename;
$display_image.="<td><img src='../temp_images/$newfilename'>";
if ($i==$extra_pic){
$display_image.="<br><a href='#' onclick='window.parent.reset_imageform($i, $delete_img);'>delete picture</a></td>";}
the "if($i==$extra_pic) is TRUE so dont mind that...
The problem is, if you click on the link 'delete picture' the function reset_imageform(nr, pic_nr) should get called, but it doesn't whenever I try to pass the variable $delete_img to the function. As soon as I remove this variable from the call like this 'reset_imageform($i);' then it works. but adding that variable, will make it not to work. The function doesnt get called at all!
The variable contains a random id nr, with an underscore, and then a filename, for example like this: 23432423439_picture.jpg
is there something Im missing here, should I do something to $delete_img before sending it in php?
All my documents are in utf-8 format!
Thanks
PS: just let me know if you need more input...