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 Like 41 Dislike
Previous forums Next forums
Other forums

error checking breaking my code
Hi there, OK first of all, big apologies for what I assume is really fundamental errors in the struc

present value of sequence?
Hi

Please help me to find out the present value of sequence?

Thanks

User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out b

Function
How can I make this function that once you click the link in the code it takes you to a new page wit

show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to

Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields

Which PHP-Editor do you think is the best?
Hi everyone,
Myself Brian Anderson. For the last 2 years i have been working a

Logging and nologging bulk insert
Hi,

oracle version: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash