jackdaniels187 Posted February 14, 2010 Share Posted February 14, 2010 Alright I am trying to deal with a small issue. I need to have a javascript popup link echod by php. This is the code I have now. I know it doesn't work. the quotes just aren't in the right place, can someone figure it out? print '<a href="unit_note1.php?id='.$unitid." onClick=\"return popitup(\'unit_note1.php?id='.$unitid.'\')">Click here</a>'; here is a html instance of the similar code <a href="unit_note1.php?id=<? print $unitid; ?>" onClick="return popitup('unit_note1.php?id=<? print $unitid; ?>')">Add note</a> Link to comment https://forums.phpfreaks.com/topic/192080-php-string-with-javascript-popitup/ Share on other sites More sharing options...
teamatomic Posted February 15, 2010 Share Posted February 15, 2010 Just a question. Why are you bothering with pop-up code? How many browsers are set to block pop-ups, how many people welcome pop-ups like a long lost friend? If you really must pop something up to your visitors look at something easy to use. I would recommend ibox. http://www.enthropia.com/labs/ibox/ HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/192080-php-string-with-javascript-popitup/#findComment-1012357 Share on other sites More sharing options...
jackdaniels187 Posted February 15, 2010 Author Share Posted February 15, 2010 that ibox is cool, not needed for this situation and won't work. Must use popup. I figured it out though. Thanks! Here is the fixed version <a href=\"unit_note1.php?id='.$unitid.' onClick="return popitup(\'unit_note1?qid='.$unitid.'\')">Click here</a> Link to comment https://forums.phpfreaks.com/topic/192080-php-string-with-javascript-popitup/#findComment-1012365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.