Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending selection from Drop Down lIst 1

Status
Not open for further replies.

lexer

Programmer
Jun 13, 2006
432
VE
Hi

I've a Drop down list filled from a mysql table and I've gpot also a text field, I want to send the selection made from the drop down list and the text field to another php program, I've receive the information from the text field but not the drop down list selection.

This is the php program with the drop down list and the text field:


<html>
<h5>Select Ext</h5>

<form method="get" action="DropDownListExtPhpShow.php" >

<p>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("calls", $con);

//query1 select Ext
$query1 = "SELECT Ext FROM structure ";
//Query
$result1 = mysql_query($query1) or die(mysql_error());


//Start Drop Down List
echo "<select name='Ext'>";

// printing the list select command

while($row1=mysql_fetch_array($result1)){
echo"<option value=>$row1[Ext]</option>";
/* values are added by looping Mysql*/
}


echo "</select>";// Closing drop down List
?>
</p>
<p>
<label>Enter Name
<input name="name" type="text" id="name">
</label>
</p>
<p>
<input type="submit" value="Submit" />
</p>
</form>
</html>

When I see the URL from the receiver program I see the value from text field "name" but "Ext" has nothing.

This is the receiver program:


<?php
$Ext=$_GET['Ext'] ;
$Name=$_GET['name'] ;


echo "$Ext"." ---- "."$Name";
?>

I dont know if I missing something in the first program to get the Ext value from the drop down list

Thaks
 
This line specifically:
Code:
echo"<option value=>$row1[Ext]</option>"

Your dropdown options have no value, so no value can get sent to the other page.

Try:
Code:
echo"<option value='[red]$row1[Ext][/red]'>$row1[Ext]</option>"




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks, That was the problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top