You are here: RE: [PHP] Re: post and variables « PHP « IT news, forums, messages
RE: [PHP] Re: post and variables

Posted by "Robbert van Andel" on 11/10/05 15:50

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 "<p>The 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 "<p>The 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"" <ross@aztechost.com> wrote in message
> news:08.40.45231.35323734@pb1.pair.com...
>
>>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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация