[PHP-DB] Re: Passing variables from HTML to PHP

2004-08-31 Thread Jasper Howard
if the checkbox is checked then you'll get the value in the php script. If
globals are turned on then echo $foo; will work, otherwise you have to use
something like: echo $_POST['foo'];

its a good idea to write your scripts without dependency on globals being
turned on, its a security risk for it to be on.

-- 


--
Jasper Howard :: Database Administration
Velocity7
1.530.470.9292
http://www.Velocity7.com/
--
Philip Thompson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all.

 This might be a simple answer, but I'm still not sure what the case is.
 Okay, so I have a form in my html that has some inputs. These each
 have a `name` and a `value` attribute to them, of course.

 I cannot seem to access the name/value pair in my php without using the
 $_POST method/variable names. Are you able to without $_POST? Example:

 ---
 html:
 input type=checkbox name=foo value=bar

 php:
 do this:
 echo foo =  . $foo; // foo = bar

 or this:
 echo foo =  . $_POST[foo]; // foo = bar
 ---

 So, should both of those php examples work the same?

 Thanks!
 ~Philip

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: Passing variables from HTML to PHP

2004-08-31 Thread Philip Thompson
Thanks for your reply. Those who have responded, I am thankful to.
~Philip
On Aug 31, 2004, at 4:14 PM, Jasper Howard wrote:
if the checkbox is checked then you'll get the value in the php 
script. If
globals are turned on then echo $foo; will work, otherwise you have to 
use
something like: echo $_POST['foo'];

its a good idea to write your scripts without dependency on globals 
being
turned on, its a security risk for it to be on.

--
--
Jasper Howard :: Database Administration
Velocity7
1.530.470.9292
http://www.Velocity7.com/
--
Philip Thompson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all.
This might be a simple answer, but I'm still not sure what the case 
is.
Okay, so I have a form in my html that has some inputs. These each
have a `name` and a `value` attribute to them, of course.

I cannot seem to access the name/value pair in my php without using 
the
$_POST method/variable names. Are you able to without $_POST? Example:

---
html:
input type=checkbox name=foo value=bar
php:
do this:
echo foo =  . $foo; // foo = bar
or this:
echo foo =  . $_POST[foo]; // foo = bar
---
So, should both of those php examples work the same?
Thanks!
~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php