italiano40 Posted August 12, 2009 Share Posted August 12, 2009 my php script i want it to echo out a javascript command like this echo "<a href=# onclick=reply(".$replyto.");>#".$row2['id']."</a>"; but my problem is if the $replyto has a string with a space the javascript function fails, so i need to know how insert (") before the $replyto and after so how would i go on doing this?? and i have tried "e; and " and both have failed ANY HELP WOULD BE GREAT Link to comment https://forums.phpfreaks.com/topic/169849-solved-help-with-creating-javascript-inside-a-php-script/ Share on other sites More sharing options...
italiano40 Posted August 12, 2009 Author Share Posted August 12, 2009 i solved it i justed add \" and \" before $replyto and after it and it is working and now javascript looks at it as a string Link to comment https://forums.phpfreaks.com/topic/169849-solved-help-with-creating-javascript-inside-a-php-script/#findComment-896106 Share on other sites More sharing options...
infiniteacuity Posted August 12, 2009 Share Posted August 12, 2009 You should mark this as resolved. Link to comment https://forums.phpfreaks.com/topic/169849-solved-help-with-creating-javascript-inside-a-php-script/#findComment-896544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.