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

Why Are These Functions Causing MASSIVE Memory Problems? Please Help!
Hi,

I have a script with some options.

I use regex to replace patterns in strings, but

Help with file_get_html
The following code gives the expected results:

<html>
<head&g

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

Add code to enable passing of checkbox variable on login
Ok, I have a login page, but want to add a checkbox that when checked and successful login is made i

Creation of Raw Exposure manually
SAP Gurus

I am creating Raw Exposure ( Hedge management ) thru T Code TEM10 with followin

Storing/displaying image urls in a database?
Hi
Basically I have the following scenario:
User chooses picture from list. Picture info is ad

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

losing variables between php brackets
Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mys

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