Forum Moderators: coopster

Message Too Old, No Replies

PHP and JS drop box

calling PHP from drop box

         

henry0

11:14 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



in a site that was mostly pure HTML I used some JS drop box
now the site is in full modif mode
translated to PHP and will use a DB

how can I use the same JS drop box format in PHP
of course using the JS script in PHP is fine
however I have no clue on how to populate the JS drop box with PHP links
can a drop box be achieved using only PHP, is there a model?
or may I use and tweak the following to fit PHP

<<<
<form name="form1">
<select name="linkslist" onChange="go(this)">
<option value=>Select an option</option>
<!--<option value="rcpbook/rcpacom1.html">Any name..
option> -->
</select>
</form>
>>>

the question is how can I pass <? link to DB?>
instead of the plain html link in the JS option value?

thank you
regards

vincevincevince

12:17 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




<?php
echo
"
<form name=\"form1\">
<select name=\"linkslist\" onChange=\"go(this)\">
<option value=>Select an option</option>";

$sql="SELECT wherever,whatever FROM table WHERE what";
$dh=mysql_query($sql);
while ($r=mysql_fetch_row($dh)) echo "<!--<option value=\"$r[0]\">$r[1]<option> -->";

echo
"
</select>
</form>
";
?>

henry0

12:37 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Vincevincevince
as usually thanks for the help
hopefully in a few months I will able to share my knowledge gained here in trying to help posters :)