Jump to content

passing form variables using submit


Archimedees

Recommended Posts

The following statement is in urllist form below.

echo "  <td>MyServer=".$value["name"]."</td>\n";

In ActiveServer.php I need to  process the strings in  $value["name"]  using $_Get["MyServer"] and assign it to $strServer

Could somebody please outline why so far this is not working??

Mad Techie??? Please assist. Thanks in advance.

 

 

<form name="urllist" action="ActiveServer.php" method="GET"> 
<table border=1>
  <tr>
    <th></th>
    <th></th>
    <th>Server</th>
<?php
  
  $arPageConf = read_contents_pageconf("page.conf");
  $arPingConf = read_contents_pingconf("ping.conf");
  
  $arPageServers = create_servernamelist_pageconf($arPageConf);
  $arPingServers = create_servernamelist_pingconf($arPingConf);
  
  //loop through PingServers to create final List
  $arFinalServers = $arPageServers;
  
  foreach($arPingServers as $nKey => $arServer)
  {
    $arFinalServers = search_array($arFinalServers, $arServer);
  }//end foreach($arPingServers as $nKey => $strServer)
  
  foreach($arFinalServers as $key => $value)
  
  {
    echo "<tr>\n";
    echo "  <td></td>\n";
    echo "  <td><input type=\"checkbox\" name=\"active_".$key."\" value=\"active\"";
    if ($value["active"]==true)
    {
      echo "checked";
    }
    echo "></td>\n";
    echo "  <td>MyServer=".$value["name"]."</td>\n";
    echo "</tr>\n"; 
  }

?>

</table>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

 

 

Now, ActiveServer.php

 

 

<?php

if (isset($_GET["submit"]) && isset($_GET["MyServer"]))
    {
      $strServer = $_GET["MyServer"];
    
    }
    else
    {
      die();
    }//end of (isset($_Request["submit"][/quote]);

?>

 

edit: We have code tags for good reason. 

Link to comment
Share on other sites

I'm Not 100% sure what your asking for here (but its lates here and i have had littel sleep) but

your doing this

echo "  <td><input type=\"checkbox\" name=\"active_".$key."\" value=\"active\"";

when personally i would do this

echo "  <td><input type=\"checkbox\" name=\"active[".$key."]\" value=\"active\"";

 

the reason is, it create an array this i can access like this

foreach($_POST['active'] as $k => $V)
{
echo "$k => $v<br>"
}

 

also you have a class which we have no info on ie

read_contents_pageconf <-- whats that do ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.