zachishi Posted September 1, 2006 Share Posted September 1, 2006 I am trying to get a popup to work with this script. I have tryed numerous javascripts and nothing seems to work. Any suggestions would be great i am really not an expert with php. We have a guy working on our site that built all this and now he is gone and I am left picking up the pieces. Thanks[code]<?php $count=0; for($i=1;$i<=$rows;$i++) { print("<tr>"); for($j=1;$j<=3;$j++) { if($count<$image_count) { if (isset($allrows[$count]['thumb']) && strlen($allrows[$count]['thumb']) > 3) { $prop_image1 = $allrows[$count]['thumb']; $prop_image = '<img src="' . $prop_image1 . '" border="0" width="125" height="94">'; } else { $prop_image = '<img src="' . APP_URL . 'images/no-pic.gif" border="0" width="125" height="94">'; } $pname = $allrows[$count]['pname']; $sleep = $allrows[$count]['sleep']; $id = $allrows[$count]['id']; $output='<a href="view-property.php?id='.$id.'" target="new">'.$prop_image.'</a><br> <a href="view-property.php?id='.$id.'" target="new"> <font size="2"><b>Eagles Ridge<BR>'.$pname.'</b></font></a> <font size="2"><b><br>'.$sleep.'</b></font>'; print("<td align='center'>$output</td>"); } else { print("<td> </td>"); } $count++; } print("</tr>"); } ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/19395-java-popup-scripts-not-working-in-my-with-my-php-help/ Share on other sites More sharing options...
wildteen88 Posted September 1, 2006 Share Posted September 1, 2006 I see no javascript code in the code provided that atempts to create a popup. Or do you mean you want a new browser window/tab to appear when the user click the link? If so use [b]_blank[/b] in the target attribute in your links. So use this:[code]$output='<a href="view-property.php?id='.$id.'" target="_blank">'.$prop_image.'</a><br>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/19395-java-popup-scripts-not-working-in-my-with-my-php-help/#findComment-84181 Share on other sites More sharing options...
zachishi Posted September 1, 2006 Author Share Posted September 1, 2006 no i have entered javascript in there and it crashes the page. I was wondering if there where any suggestions for ones that play well with that php code. Cause i cannot find any. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/19395-java-popup-scripts-not-working-in-my-with-my-php-help/#findComment-84236 Share on other sites More sharing options...
wildteen88 Posted September 1, 2006 Share Posted September 1, 2006 How are you putting the javascript in. When you put the javascript in use Heredoc syntax, or make sure you are escaping your quotes. Using HEREDOC saves you from escaping your quotes: eg:[code=php:0]echo <<<JSCRIPT -- your javascript code here --JSCRIPT;// DO NOT INDENT ABOVE LINE OR PUT ANYTHING ELSE ON IT, As it'll result in a fatal error.[/code]Also when ever you are ouputting anything to the browser make sure you put in an echo statement. Quote Link to comment https://forums.phpfreaks.com/topic/19395-java-popup-scripts-not-working-in-my-with-my-php-help/#findComment-84301 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.