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
How do i do multi uploads?.
Hey i would like to do this : http://hosting.mrkrabz.net/
I've got the base down you can uplo
Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not
Does deleting the spmlog directory critical?
Hi Everyone,
Please, hope you could help me. We're having problems with the SAP backup. I
Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki
=> and <=
So I was digging through some code when I came across the <= operator. This is the first tim
Sales orders ans reservations not taken into account on MPS / MRP
Hello,
I am implementing the MPS / MRP and I have the following problem:
I ha
how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s
convert PHP array to Javascript array
I have a page that gets a request sent from AJAX, and I am trying to convert a PHP array to a javasc
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
Automatically Detect Phone Model for WAP Jar Deployment
Making a wap site is fairly simple, but I'd like to know if there's a way to make it so that the wap