two word variable
Posted: Tue Mar 09, 2010 5:44 am
Hello, I hope someone can help me with this...
I have a dynamic drop down menu where items ( addresses ) are pulled from sql table.
However,I have a problem to post value when address has two words, like "New Avenue".
What I`m getting on next page is only "New", which is not good for me. I would need both words. Code is below..
THANKS !
<!-------------begin form------------>
<form method="post" action="scoe_v.php">
<input type="Hidden" name="send" value="true">
<TABLE>
<TD> <font size="2" face="Verdana">Address:</font> </td><td>
<?php
$query="select address from contacts order by address";
$result = mysql_query ($query);
echo "<select name=t1 value=''>Select one</option>";
while($nt=mysql_fetch_array($result)){
echo "<form method=post action=scoe_v.php>
<option value=$nt[address]>$nt[address]</option>";
}
echo "</select>";// Closing of list box
?>
</TABLE> <br>
<TABLE>
<TR>  
<TD> <input type="submit" value="Search" name="Submit"></TD>
</TR>
</TABLE>
</FORM>
<!-------------end form------------>
scoe_v.php -->
$t1=mysql_real_escape_string ($_POST['t1']);
echo "Address: $t1<br>";
With this code, only "New" is showing, even though i would need "New Avenue"..
I have a dynamic drop down menu where items ( addresses ) are pulled from sql table.
However,I have a problem to post value when address has two words, like "New Avenue".
What I`m getting on next page is only "New", which is not good for me. I would need both words. Code is below..
THANKS !
<!-------------begin form------------>
<form method="post" action="scoe_v.php">
<input type="Hidden" name="send" value="true">
<TABLE>
<TD> <font size="2" face="Verdana">Address:</font> </td><td>
<?php
$query="select address from contacts order by address";
$result = mysql_query ($query);
echo "<select name=t1 value=''>Select one</option>";
while($nt=mysql_fetch_array($result)){
echo "<form method=post action=scoe_v.php>
<option value=$nt[address]>$nt[address]</option>";
}
echo "</select>";// Closing of list box
?>
</TABLE> <br>
<TABLE>
<TR>  
<TD> <input type="submit" value="Search" name="Submit"></TD>
</TR>
</TABLE>
</FORM>
<!-------------end form------------>
scoe_v.php -->
$t1=mysql_real_escape_string ($_POST['t1']);
echo "Address: $t1<br>";
With this code, only "New" is showing, even though i would need "New Avenue"..