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]
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]
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.