Jump to content

Java popup scripts not working in my with my php. Help!


zachishi

Recommended Posts

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>&nbsp;</td>");
}
$count++;
}
print("</tr>");
}
?>
[/code]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.