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

fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw

Need help with cin setw
I made a program here is my code:

#include
#include
#i

Email Form Syantax Issue 2
How to make this look FROM:"OUR TEAM" instead of FROM:abc@mail.com

$headers = "

records between 2 dates
Hello all,

I have a date tracked table which contains effective_start_date and effective

PHP referral database. I would like this form to email the referrer.
Okay, Hello I've been trolling for years. This the first time I've ever asked for php help. Normally

help with email script...
hey

I need help with my mail script

when the form on http://www.mcgdesignstudio.com/c

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

This must be easy , pulling the last record of the day, every day, from a txt
I have a txt file logging weather data every minutes (so 1 record per minute). I want to extract the

MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which

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