I have the following code to select an item from a drop down menu and
call the same script over again. I am expecting that after the first
time the script is run the first echo would produce the selected PBX
name (e.g. FMSite) but instead I get FMSitepbx=FMSit e.
Needless to say this screws up the further processing I want to do. What
I really want to do is set a cookie containing the selected PBX name so
other scripts can get the cookie and provide specific data.
Thanks,
Mike
<?php
echo($_POST['pbx']);
$dbcnx = @mysql_connect( "localhost" , "***", "********** ");
if (!dbcnx){
echo( "<p>Unable to connect to database.</p>");
exit();
}
if ( !@mysql_select_ db("inet") ) {
echo( "<p> Unable to locate the iNet database. " . mysql_error() .
"</p>" );
exit ();
}
$query = 'Select Name from PBX order by Name';
$result = mysql_query ($query)
or die ('Query Failed');
echo '<form action="setpbx. php" method="POST">' ;
echo 'Select PBX <select name="pbx">';
while ($row = mysql_fetch_arr ay ($result)) {
echo '<option value="' . $row['Name'] . '">' . $row['Name'];
}
echo '</select>';
echo '<input type="submit" value="Submit"> ';
echo '</form>';
?>
call the same script over again. I am expecting that after the first
time the script is run the first echo would produce the selected PBX
name (e.g. FMSite) but instead I get FMSitepbx=FMSit e.
Needless to say this screws up the further processing I want to do. What
I really want to do is set a cookie containing the selected PBX name so
other scripts can get the cookie and provide specific data.
Thanks,
Mike
<?php
echo($_POST['pbx']);
$dbcnx = @mysql_connect( "localhost" , "***", "********** ");
if (!dbcnx){
echo( "<p>Unable to connect to database.</p>");
exit();
}
if ( !@mysql_select_ db("inet") ) {
echo( "<p> Unable to locate the iNet database. " . mysql_error() .
"</p>" );
exit ();
}
$query = 'Select Name from PBX order by Name';
$result = mysql_query ($query)
or die ('Query Failed');
echo '<form action="setpbx. php" method="POST">' ;
echo 'Select PBX <select name="pbx">';
while ($row = mysql_fetch_arr ay ($result)) {
echo '<option value="' . $row['Name'] . '">' . $row['Name'];
}
echo '</select>';
echo '<input type="submit" value="Submit"> ';
echo '</form>';
?>
Comment