Re: [PHP] Re: post and variables

2005-11-10 Thread Jochem Maas

Ross wrote:

Sorry I got confused. I am using variable variables.

Disregard.
Ross [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]



Thanks fpr all the feedback on the password but I have another one...

How do I use $_POST with variables. Cant find an example of this anywhere 
on php.net



if ($_POST['$table_name== 1']) {


$tablename = 'yourtable';

if (isset($_POST[ $tablename ])  $_POST[ $tablename ] == 1) {
echo $tablename, ' has been selected';
}



//do something

}

Ta,

ross 





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



RE: [PHP] Re: post and variables

2005-11-10 Thread Robbert van Andel
Essentially, Ross, you can use $_POST variables as a regular associative
array.  $_POST values come from the posted values in a form.  If you have a
form element called table_name, and your form uses the post method (as
opposed to the get method), your script would have $_POST['table_name']
available to it.  As the example below shows, you can then check its value.
The value of $_POST['table_name'] is the value that was entered in the
corresponding form element.  In this case, you're looking to see if it's
equal to 1.  If you want to output the value of a $_POST variable, you could
do something like

echo pThe value of table_name is {$_POST['table_name']}/p\n;

or if you don't have a free flowing input box you would probably want to
output the value with htmlentities or htmlspecialchars.

echo pThe value of table_name is  . htmlentities($_POST['table_name']) .
/p\n;

I hope this helps.  The previous posters are right though, there is lots of
documentation out there

Robbert



Ross wrote:
 Sorry I got confused. I am using variable variables.
 
 Disregard.
 Ross [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 
Thanks fpr all the feedback on the password but I have another one...

How do I use $_POST with variables. Cant find an example of this anywhere 
on php.net


if ($_POST['$table_name== 1']) {

$tablename = 'yourtable';

if (isset($_POST[ $tablename ])  $_POST[ $tablename ] == 1) {
echo $tablename, ' has been selected';
}


//do something

}

Ta,

ross 
 
 

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

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