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

Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

distinct rows
Hi
version 10.2.0.3

I have a query output something like the following

ID

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

Class not found error
I am getting Class 'index' not found in Eval function:

//write config

$pat

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

subtract 1 from value entered in text field
Hi

How do I subtract 1 from the vaue entered into a text field?

Thanks

How to display value in drop down list after form has been reloaded
Please bear with me as I am very new to php and html.

I have a form with several drop down me

Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make

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