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
258
41
Other php-forum
IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:
Code: $query = "SE
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor
A little help needed passing hidden values to next page
I have a page that has hidden values in a form.
example
Code: <input name='signupID
multiple recipients + dbuser mail recall
Hello,
I am building a php login script.
When the user registers the script will send
form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for
Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc
in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)
Examp
get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i
error reporting
hey everyone
I have a production server in which I want error reporting but only on some page
use an array from 1 class in a second class
I have a class that adds data to an array
Then I have a second class and I need to check if t