Javascript function in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yeo_yeo2000
Forum Newbie
Posts: 6
Joined: Fri Oct 22, 2004 9:26 am

Javascript function in PHP

Post 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>";
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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...
Last edited by CoderGoblin on Tue Oct 26, 2004 7:47 am, edited 3 times in total.
The Monkey
Forum Contributor
Posts: 168
Joined: Tue Mar 09, 2004 9:05 am
Location: Arkansas, USA

Post by The Monkey »

Code: Select all

<?php
$list .= '<td><a href="" onClick="poptastic(''row1.htm'');"><img src="getdata.php3?id=' . $row['id'] . '" /></a></td>';
?>
yeo_yeo2000
Forum Newbie
Posts: 6
Joined: Fri Oct 22, 2004 9:26 am

Post by yeo_yeo2000 »

Thanks,
I knew it was something stupid. Not having a good day!
Post Reply