RE: [PHP] Why Doesn't My Javascript Work With PHP?
| From: | Ben Ocean | Date: | Wed, 23 Aug 2000 14:05:07 +0000 |
| Subject: | RE: [PHP] Why Doesn't My Javascript Work With PHP? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13149@lists.php.net to get a copy of this message | ||
At 09:07 AM 8/23/2000 +0100, you wrote:
Hi Could you show us the code once it gets to the browser? My first suspicion is that you have some form of magic quoting screwing up your javascript output by tranforming ' in \' or something...I like the way you trouble-shoot, Joelle. The script is *supposed* to look like this... function horseWindow() {
newWindow = window.open("Your_Horse.php3?name=<? echo
$namee; ?>&color=<? echo $coloree; ?>&gender=<? echo $genderee;
?>&price=<? echo
$pricee; ?>&birth=<? echo $birthee; ?>&performance_one=<? echo
$performance_onee; ?>&performance_more=<? echo $performance_moree; ?>&height=<?
echo $heightee; ?>&description=<? echo $descriptionee; ?>","","toolbar=1,menubar=0,width=800,height=600,scrollbars=1,status=0,location=0,directories=0,left=0,top=0");
...but all I get is this...
fuction horseWindow() {
newWindow=window.open("Your_Horse.php3")
I presume *that's* why it assumes the last value to be generated by the *while* statement. Now, how do I get it to *stick*? Again, here's an example of the *while* statement:
elseif ($genderz !=9) {
echo "<span class=\"resultsHeader\"><h1>Here's Your Horses!</h1></span>";
echo "<span class=\"lead\">";
echo "Click on any horse. It will open a new window. To see another horse from this selection, simply close down that window and you'll be right back here!</span>";
echo "<span class=\"results\">";
$result = mysql_query("SELECT id, gender, color, name, birth, price, performance_one, performance_more, height, description FROM horse ORDER BY price");
$total_rows = mysql_numrows($result); $counter = 0; $countertwo = 0;
while($counter < $total_rows):
$id = mysql_result($result,$counter,"id");
$genderee = mysql_result($result,$counter,"gender");
$namee = mysql_result($result,$counter,"name");
$coloree = mysql_result($result,$counter,"color");
$pricee = mysql_result($result,$counter,"price");
$birthee = mysql_result($result,$counter,"birth");
$performance_onee = mysql_result($result,$counter,"performance_one");
$performance_moree = mysql_result($result,$counter,"performance_more");
$heightee = mysql_result($result,$counter,"height");
$descriptionee = mysql_result($result,$counter,"description");
if ($genderee == $genderz) {
?>
<a href="#a" onClick="horseWindow()">
<script language="Javascript1.2">
function horseWindow() {
newWindow = window.open("Your_Horse.php3?name=<? echo
$namee; ?>&color=<? echo $coloree; ?>&gender=<? echo $genderee;
?>&price=<? echo
$pricee; ?>&birth=<? echo $birthee; ?>&performance_one=<? echo
$performance_onee; ?>&performance_more=<? echo $performance_moree; ?>&height=<?
echo $heightee; ?>&description=<? echo $descriptionee; ?>","","toolbar=1,menubar=0,width=800,height=600,scrollbars=1,status=0,location=0,directories=0,left=0,top=0");
}
</script>
<?
echo mysql_result($result,$counter,"name");
echo "</a><br>";
$countertwo = $countertwo + 1;
}
$counter = $counter + 1;
endwhile;
echo "</span>";
if ($countertwo == 0) {
echo "<span class=\"sorry\">I'm sorry, but there are no horses that fit your criteria. click the "Back" button on this browser window and try another search.</span>";
}
}
TIA,
BenO