Hello All,
I have created a script to edit rows in a table. When the editable part comes up (ser_change.php) it brings up 4 input boxes , containing the original data inputed.. two of the input boxes are drop down menus displaying automatically the intial value of inputed.. dropping the menus down we can see the entire list of choices that they can change it to. The problem i am having is when i am finshed editing .. i click amend and the variables from both the drop down boxes are not parsing to the next script (ser_changeit.php) to do further querying for the final input( ID of selected drop down box will be inputed.. not the name itself)
AS you can see i am trying to grab the selected values by using the ISSET on the ser_changeit.php however, always comes up blank while the other variables are parsing no problems(name, ip)
I believe my problem lies in the way i am displaying the value previously chosen as default and all possible values in the drop menu. but I don't know another way to do it.. Included here are both the parts of the script in question.. anyhelp would be appreicated..
Ser_change.php**********************************
echo "Office <BR>";
$sql4="SELECT * FROM sites LEFT JOIN servers ON servers.site_ID = sites.site_ID where servers.server_ID = '$row_id' ";
$mysql_result4 = mysql_query($sql4,$connection);
while ($row4=mysql_fetch_array($mysql_result4))
{
$site_name=$row4["site"];
}
echo "<SELECT NAME=\site_name\">";
echo "<OPTION SELECTED>$site_name";
$mysql_result3 = mysql_query($sql3,$connection);
while ($row3=mysql_fetch_array($mysql_result3))
{
$site=$row3["site"];
echo "<OPTION >$site";
}
echo "</SELECT>";
echo "<BR><BR>";
}
echo "Server Type <BR>";
$sql5="SELECT * FROM server_types LEFT JOIN servers ON servers.server_type = server_types.type_ID where servers.server_ID = '$row_id' ";
$mysql_result5 = mysql_query($sql5,$connection);
while ($row5=mysql_fetch_array($mysql_result5))
{
$type_nameALL=$row5["type_name"];
}
echo "<SELECT NAME=\type_name\">";
echo "<OPTION SELECTED>$type_nameALL";
$mysql_result2=mysql_query($sql2,$connection);
$num_rows2=mysql_num_rows($mysql_result2);
while ($row2=mysql_fetch_array($mysql_result2))
{
$type_name=$row2["type_name"];
echo "<OPTION>$type_name";
}
echo "</SELECT>";
echo "<BR><BR>";
echo "<INPUT TYPE= SUBMIT VALUE=\"Amend Record\">";
mysql_close($connection);
?>
</FORM>
</BODY>
</HTML>
ser_changeit.php*******************************
<BODY>
<?php
_it.php
include file
include ("magops_info.php");
if we are sending back a protect form contents
if (isset($_GET['row_id']))
$row_id = $_GET['row_id'] ;
if (isset($_GET['type_ID']))
$type_ID = $_GET['type_ID'] ;
if (isset($_GET['site_name']))
$site_name = $_GET['site_name'] ;
if (isset($_GET['name']))
$name = $_GET['name'] ;
if (isset($_GET['ip']))
$ip = $_GET['ip'] ;
$sql5="SELECT name FROM servers Where name LIKE '$name'";
$mysql_result5=mysql_query($sql5,$connection);
$num_rows5=mysql_num_rows($mysql_result5);
$sql="SELECT site_ID, site FROM sites Where site='$site_name'";
$sql2="SELECT type_ID, type_name FROM server_types Where type_name ='$type_name'";
$mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result);