User input in to variable
Posted on
16th Feb 2014 07:03 pm by
admin
Hi all,
I'm sure this is very easy but I'm having another brain freeze!
At the end of the code I have echoed 3 bits of info to screen $ip, $_POST['ssid'] and $ssid_id".
I would like to put $_POST['ssid'] into a variable, is this possible?
Jamie
Code: <?php
//run site query
require("confwifi.php") ;
{
$ext_site = $_POST['site'];
$extract = mysql_query ("SELECT * FROM site WHERE site='$ext_site'");
$numrows = mysql_num_rows ($extract);
while ($row = mysql_fetch_assoc($extract))
{
$id = $row['id'];
$site = $row['site'];
$ip = $row['ip'];
}
}
?>
<?php
//run site query
require("confwifi.php") ;
{
$ext_ssid = $_POST['ssid_name'];
$extract = mysql_query ("SELECT * FROM ssid WHERE ssid_name='$ext_ssid'");
$numrows = mysql_num_rows ($extract);
while ($row = mysql_fetch_assoc($extract))
{
$ssid_id = $row['ssid_id'];
$ssid_name = $row['ssid_name'];
}
}
?>
<form name="form1" method="POST" action="wifichange.php"><div>
<select name="site">
<option value="0" selected>(please select:)</option>
<option name="site">Llandaf</option>
<option name="site">Cyncoed</option>
<option name="site">Howard Gardens</option>
<option name="site">Colchester Avenue</option>
</select>
<select name="ssid_name">
<option value="0" selected>(please select:)</option>
<option name="ssid_name">Guest</option>
<option name="ssid_name">Conferences</option>
</select>
</form>
<p><input type="text" name="ssid"></div></P>
<div><input type="submit" value="submit"></div>
</form>
<?php echo "$ip"; ?><p></p>
<?php echo $_POST['ssid'];; ?><p></p>
<?php echo "$ssid_id"; ?><p></p>
<?php
No comments posted yet
Your Answer:
Login to answer
258
41
Other forums
Php script to read msword file
hi,
I need to read a msword file and i want to print the contents in that word file.
i
How to get variable value on next page
Hello friends
i am working on payentry page ..there i have this code.........
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h
Edit MySQL Row Using PHP and HTML Form
Hello,
Here's what I'm trying to do. Build a page where a user enters a MySQL row number in.
RadioButtonList item spacing
I have a RadioButtonList and I can't put any spacing between the items. They are arranged verticall
Google Wave
So... has anyone used it yet? Is it any good?
http://wave.google.com/help/wave/about.html#vid
urldecode question
How would I format this line of code properly?
<?php echo urldecode($_GET['Title']); ?
Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho
List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab
single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be