Hello,
I have a drop-down menu that lists 25 items (vips), when selecting one item (multiple= "no"), the page reloads and opens another dropdown menu with 20 items (Servers) (multiple= "no").
When the user selects a server from the 2nd drop down, the are asked to complete a final action (two radio buttons) either "on" or "off".
Based on this final selection the user is taken to a new page and a script is run to turn on\off the server they selected.
The problem is I am unable to pass the selections from the drop-down menus along with the radio button selection. How do I pass all three selections to the final page.
My code is a little sloppy, but here is an example of what I have:
***************CODE***************************
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css"
href="PSM_CSS.css" />
<META NAME="GENERATOR" Content="SAPIEN Technologies PrimalScript 3.0">
<TITLE>Document Title</TITLE>
</HEAD>
<BODY background class="rightmain">
<?php
include 'PSM_Connect.php'; // Connection to PSM
echo "<h1>Placing Adservers IN & Out of Service</h1>";
echo "<h4>Please Select a POP\BigIP</h4>";
$query="select distinct name from pop Order by name ASC"; //Query designed to return from PSM a list of only Adserver Pops
$result=mysql_query($query) or die('Query failed: ' . mysql_error()); //Load the list of pops into variable $result.
echo "<form name=\"myform\" method=POST>
<select name=pop[] size=4 onchange=\"document.myform.submit()\">"; echo "<option value=Choose One>Choose One</option>";
while ($pop_query = mysql_fetch_row($result)){
$pop=$pop_query[0];
echo "<option value=$pop>$pop</option>";
}
echo "</select>";
echo "</form>";
if (isset($POST['pop'])){
$pop_name = $POST['pop'];
foreach ($pop_name AS $pop_value){
if (isset($_POST['pop'])){
echo "<h4>Please Select a Server</h4>";
echo "<form name=\"myform2\" method=POST>
<select name=server size=4 onchange=\"document.myform2.submit()\">";
$query="select s.name from server s,pop p where s.pop_id=p.id and p.name='$pop_value'ORDER by s.name ASC"; $result=mysql_query($query) or die('Query failed: ' . mysql_error());
while ($pop_pop = mysql_fetch_array($result)) {
$svr = $pop_pop["name"];
echo "<option value=$svr>$svr</option>";
}
}
}
echo "</select>";
echo "</form>";
}
if (isset($POST['server'])){
$server= $POST['server'];
$query="select ip from server where name='$server'"; $result=mysql_query($query) or die('Query failed: ' . mysql_error());
while ($ip_query = mysql_fetch_row($result)){ $ip=$ip_query[0];
}
echo "<br >";
echo "I want to take $server:";
echo "<form name=input action=OOS_Results.php method=POST>";
echo "<input type=\"hidden\" value=\"$pop\" name=pop>\n";
echo "<input type=\"hidden\" value=\"$svr\" name=server>\n";
echo "<input type=radio name=service value=IS checked=Checked>IN-Service";
echo "<input type=radio name=service value=OOS>Out Of Service";
echo "<input type=submit value=Submit target=_blank>";
echo "</form>";
}
?>
</BODY>
</HTML>