Page 1 of 1

Javascript function in PHP

Posted: Tue Oct 26, 2004 7:30 am
by yeo_yeo2000
Hi all,
I am trying to call a javascript funtion poptastic which pops up a new window showing an image. I am having problems calling the javascript function from inside the php code. Probably something stupid but heres the code

$list .= "<td><a href=':poptastic('row1.htm');'><img src='getdata.php3?id=".$row['id']."'</a></td>";

Posted: Tue Oct 26, 2004 7:44 am
by CoderGoblin

Code: Select all

$list .= "<td><a href="javascript:poptastic('row1.htm');"><img src="getdata.php3?id=".$row&#1111;'id'].""></a></td>";
Also shouldn't you have an image for the img source...

Posted: Tue Oct 26, 2004 7:44 am
by The Monkey

Code: Select all

<?php
$list .= '<td><a href="" onClick="poptastic(''row1.htm'');"><img src="getdata.php3?id=' . $row['id'] . '" /></a></td>';
?>

Posted: Tue Oct 26, 2004 7:51 am
by yeo_yeo2000
Thanks,
I knew it was something stupid. Not having a good day!