Forum Moderators: open

Message Too Old, No Replies

JavaScript and PHP

problems with onclick event in php

         

mikey_b

8:33 am on May 5, 2005 (gmt 0)

10+ Year Member



hi there webmaster world,

im pritty new to php and im having trouble with javascript and php.....

im trying to pull data out of a database (which works) and some of that data that is taken out is external url links.

heres my echo statement...

echo("><td>" . $row['Name'] . "</td><td>" . $row['Title'] . "</td><td><a href=" . $row['URL'] . "onclick='javascript:popupWin(this,'800','600');'>" . $row['URL'] ."</a></td></tr>");

its not so much an error that i get, its that it reads the url as the acctual url AND onclick='javascript:popupWin(this,800,600); so the link cant be found, how can i sort this out

please please guy help a new guy

Rambo Tribble

12:58 pm on May 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you want:

onclick="window.open(this.href,'','width=800,height=600');"

mikey_b

1:03 pm on May 5, 2005 (gmt 0)

10+ Year Member



cheers i got it working with your help :D