CoreyR Posted May 3, 2007 Share Posted May 3, 2007 Anyone know why this wouldn't work? I've tried several different ways and have read several posts. Print "<div class='sponsors_cell'><a href='http://www.sanjoseteam.com/info-request/new-listings-email.html' onclick='window.open('http://www.sanjoseteam.com/info-request/new-listings-email.html', 'contact', 'status=no,resizable=no,width=550,height=560'); return false'><img src='http://www.sanjoseteam.com/images/santa_clara_listings' alt='Blossom Valley Real Estate' width='125' height='125' vspace='4' border='0' /></a><br />"; Link to comment https://forums.phpfreaks.com/topic/49856-solved-php-onclick-event/ Share on other sites More sharing options...
taith Posted May 3, 2007 Share Posted May 3, 2007 that would be a javascript issue... not a php one... but this should work... simple php function to do just that :-) <? function popup($text, $link, $name="", $height="300", $width="300", $resizable="0", $status="0", $class=""){ return '<a href="javascript:void(0);" onclick=\'javascript: window.open("'.$link.'", "'.$name.'", "status='.$status.', height='.$height.', width='.$width.', resizable='.$resizable.'")\' class='.$class.'>'.$text.'</a>'; } ?> Link to comment https://forums.phpfreaks.com/topic/49856-solved-php-onclick-event/#findComment-244581 Share on other sites More sharing options...
obsidian Posted May 3, 2007 Share Posted May 3, 2007 Anyone know why this wouldn't work? I've tried several different ways and have read several posts. Print "<div class='sponsors_cell'><a href='http://www.sanjoseteam.com/info-request/new-listings-email.html' onclick='window.open('http://www.sanjoseteam.com/info-request/new-listings-email.html', 'contact', 'status=no,resizable=no,width=550,height=560'); return false'><img src='http://www.sanjoseteam.com/images/santa_clara_listings' alt='Blossom Valley Real Estate' width='125' height='125' vspace='4' border='0' /></a><br />"; It's because your quotes are canceling out when the HTML gets to the browser. You need to change your quotes around a tad. Try this instead: <?php print "<div class='sponsors_cell'><a href='http://www.sanjoseteam.com/info-request/new-listings-email.html' onclick=\"window.open('http://www.sanjoseteam.com/info-request/new-listings-email.html', 'contact', 'status=no,resizable=no,width=550,height=560'); return false\"><img src='http://www.sanjoseteam.com/images/santa_clara_listings' alt='Blossom Valley Real Estate' width='125' height='125' vspace='4' border='0' /></a><br />"; ?> Link to comment https://forums.phpfreaks.com/topic/49856-solved-php-onclick-event/#findComment-244597 Share on other sites More sharing options...
CoreyR Posted May 3, 2007 Author Share Posted May 3, 2007 Damn, that worked great. Thank you!! Link to comment https://forums.phpfreaks.com/topic/49856-solved-php-onclick-event/#findComment-244705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.