FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » combobox
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
combobox [message #177312] Wed, 07 March 2012 21:15 Go to previous message
ecu_jon is currently offline  ecu_jon
Messages: 3
Registered: March 2012
Karma:
Junior Member
i am trying to make a combo box, choose from a list or type in new. i
lifted code from another page i did that had the drop-down list, and
tried to add it to several text boxes. it is not pushing the choice
choosen from the drop-down on to the nextpage/sql. frustraded, i
didn't do much more then copy pasta from the other page, just massaged
it a little to fit in, just does not work. have excluded the fluff
html surrounding this, just imagine basic html,head,body tags.

<?php

$host="localhost"; // Host name
$username="name"; // Mysql username
$password="pword"; // Mysql password
$db_name="name"; // Database name
$tbl_name="othername"; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot
connect");
mysql_select_db("$db_name")or die("cannot select DB");
$result = mysql_query("SELECT DISTINCT client FROM client ORDER BY
client ASC") or die(mysql_error());
echo '<form action="./page5.php" method="post"><pre>';
echo 'Client ';
echo '<select name="option">';
while($row= mysql_fetch_array($result)){
echo "<option value=\"$row[client]\">$row[client]</option>\n";}
mysql_close();
echo '</select>';
echo '<input type="text" maxlength="70" name="Client"><br />';
echo 'Site <input type="text" maxlength="70"
name="Site"><br />';
echo 'First,Last Name <input type="text" maxlength="20"
name="Uname"><br />';
echo 'User ID <input type="text" maxlength="20"
name="Uid"><br />';
echo 'Password <input type="text" maxlength="20"
name="Password"><br />';
echo 'Status <input type="text" maxlength="20"
name="Status"><br />';
echo '<input type="submit" value="submit" name="submit"><br />';
echo '</pre></form>';
if(isset($_POST['Client'])) $Client = $_POST['Client'];
if(isset($_POST["Site"])) $Site = $_POST["Site"];
if(isset($_POST["Uname"])) $Uname = $_POST["Uname"];
if(isset($_POST["Uid"])) $Uid = $_POST["Uid"];
if(isset($_POST["Password"])) $Password = $_POST["Password"];
?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: which command to use
Next Topic: Parse error: syntax error, unexpected T_VARIABLE
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 05:19:31 GMT 2024

Total time taken to generate the page: 0.04797 seconds