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!

Did you know?Explore Trending and Topic pages for more stories like this.
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

noob question
i traying to do a php form with auto replay for both(me and the user who send me a mail),

a u

Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to

Why doesn't this work? (SSH2)
This is my script:

Code: <?php
$connection = ssh2_connect('213.251.167.109', 22);

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

How to search for several parameters from objects in a database?
I have a database with lots of information about objects.
Now I would like to search for 4 or 5 p

get font info from a font file
hello,

Does anyone know how to get font info from a font file ... using php of course !
<

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

email form (cannot find the problem)
Hello there. I've been having trouble with an email form. Can't find the problem really. I've tested

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

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