0

Hi,

I have a web site in which I pass many javascript variables to php and the other way round. This is my last passing variable challenge, and I cannot figure it out.

There's an alphabet letter that i pass into showhide1(v) function, and i try to pass it to IN(). For example IN ('b') will retrieve all items beginning with letter b.

The way I did it below does not work for some reason. Does anyone know how to do it?

Thanks

function showhide1(v)
{

<?php
$result = mysql_query("SELECT * FROM birdstable
WHERE left(Name, 1) IN ($_GET[v]) 
ORDER BY Name;"); 

while($row = mysql_fetch_assoc($result)){  
$varr= $row['BirdID'];
?>
document.getElementById("Layer1").innerHTML = "hello";

<?php

}
?>


}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Shanti C
0

i think you can't get the java script function values by this way: $_GET[v].
if you want to send javascript values to php try this way:

function showhide1(x)
{
d.action="yourpage.php?v="+x;
d.submit();
}

And the you can get the function value by $_GET;
then pass it to N() ...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.