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
making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j
Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i
Ajax Issues - Update Panel / Timer. Intellisense doesn't know about them
Type 'System.Web.UI.ScriptManager' does not have a public property named 'UpdatePanel'.
That is wha
remove innitial and
tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al
Page not Loading After Test
Hey All
It seemed that an inlcude statement wasn't working for some reason, so I tried a more
Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat
Help to integrate whois Domain Details to website
Hi,
can i know is their any php script r methods to add domain details to my website.
GIS appliction help
I found some tutorials in the internet to develop a map application I don't want to use google maps
php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecur