Guest upirate Posted March 13, 2007 Share Posted March 13, 2007 if (isset($search)) { return "<A HREF=javascript:popUp(emailsearch.php?mysearch=".$search.")>Email Search to Friend</A>"; } something wrong in my return statement. The popup window is not opening. Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/ Share on other sites More sharing options...
papaface Posted March 13, 2007 Share Posted March 13, 2007 All you need to do is this: if (isset($search)) { echo "<a href="javascript:popUp(emailsearch.php?mysearch=".$search.")">Email Search to Friend</a>"; } Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206383 Share on other sites More sharing options...
Guest upirate Posted March 13, 2007 Share Posted March 13, 2007 same thing as before. The popup window will not open due to malformed html. :-\ Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206386 Share on other sites More sharing options...
papaface Posted March 13, 2007 Share Posted March 13, 2007 So correct the HTML..... Actually the HTML is fine, its the javascript that is the problem. This is a PHP forum. Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206390 Share on other sites More sharing options...
Guest upirate Posted March 13, 2007 Share Posted March 13, 2007 Its not the javascript problem. the string that I am returning is not formed well its php syntax Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206412 Share on other sites More sharing options...
Guest upirate Posted March 13, 2007 Share Posted March 13, 2007 actually it was my fault. it was the search variable . thanks again!!! Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206414 Share on other sites More sharing options...
papaface Posted March 13, 2007 Share Posted March 13, 2007 Its also the way it is echo'ed Should be: if (isset($search)) { echo '<a href="javascript:popUp(emailsearch.php?mysearch='.$search.')">Email Search to Friend</a>'; } Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206415 Share on other sites More sharing options...
craygo Posted March 13, 2007 Share Posted March 13, 2007 Can try this echo "<a href=\"emailsearch.php?mysearch=".$search."\" onclick=\"window.open(this.href);return false;\" target=\"newWin\">Email Search to Friend</a>"; Ray Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206423 Share on other sites More sharing options...
Guest upirate Posted March 13, 2007 Share Posted March 13, 2007 thanks Ray ! Link to comment https://forums.phpfreaks.com/topic/42541-solved-returning-a-string-from-a-function-xtra-simple-yet-im-stumped/#findComment-206425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.