Passing Variables With Onclick...
Posted: Sun Aug 05, 2007 1:02 am
First I want to thank those that helped with a previous question regarding OnClick. Perhaps you can bear with my on another thought I had.
Throughout my page I want to provide the user either buttons or text that will make selections from my database based on the various criteria. As an example, if they click the graphics image "A", it then refreshes the screen and in a section of the screen, all members with names beginning with an "A" appears.
One option is to create 26 pages and use the following OnClick event:
<img border="0" src="images/alphabet/A.jpg" width="24" height="24" vspace="2" onclick=" FP_goToURL(/*href*/'directories/directory%20(a).php')"></td>
Within the called page I would have a Select statement such as:
$query_members="SELECT * FROM Members WHERE BusinessNameKey = 'A' ORDER BY BusinessName";
$query_members="SELECT * FROM Members WHERE BusinessNameKey = 'B' ORDER BY BusinessName";
etc.
Life would be made a whole bunch simpler if I could pass a variable to the called URL. Does anyone know the syntax of such a statement?
My second question is this....
On the primary page, I am also displaying from my database various Business Types. As those business names are drawn from the database I would like to format them with OnClick properties so that when the user clicks them I go to another page, once again passing the text/Business Type selected. The called URL would have a SQL statement such as:
$query_members="SELECT * FROM Members WHERE BusinessType = $businesstype ORDER BY BusinessName";
I am lost as to the syntax of this statement as well.
I would once again like to thank you in advance for any input you could provide...
Throughout my page I want to provide the user either buttons or text that will make selections from my database based on the various criteria. As an example, if they click the graphics image "A", it then refreshes the screen and in a section of the screen, all members with names beginning with an "A" appears.
One option is to create 26 pages and use the following OnClick event:
<img border="0" src="images/alphabet/A.jpg" width="24" height="24" vspace="2" onclick=" FP_goToURL(/*href*/'directories/directory%20(a).php')"></td>
Within the called page I would have a Select statement such as:
$query_members="SELECT * FROM Members WHERE BusinessNameKey = 'A' ORDER BY BusinessName";
$query_members="SELECT * FROM Members WHERE BusinessNameKey = 'B' ORDER BY BusinessName";
etc.
Life would be made a whole bunch simpler if I could pass a variable to the called URL. Does anyone know the syntax of such a statement?
My second question is this....
On the primary page, I am also displaying from my database various Business Types. As those business names are drawn from the database I would like to format them with OnClick properties so that when the user clicks them I go to another page, once again passing the text/Business Type selected. The called URL would have a SQL statement such as:
$query_members="SELECT * FROM Members WHERE BusinessType = $businesstype ORDER BY BusinessName";
I am lost as to the syntax of this statement as well.
I would once again like to thank you in advance for any input you could provide...