You are here: Re: $_POST « All PHP « IT news, forums, messages
Re: $_POST

Posted by Gerry Vandermaesen on 04/24/06 15:55

wesley@ispace.co.za wrote:
> I have tried that also. But the problem is that the value of the
> variable gets created dynamically.
> The problem is that i have an unlimited number of checkboxes on one
> page. So i am using an array to name them. I want to retriev the values
> from the checkboxes using another script. But, i cannot seem to
> retrieve these values.

so your HTML should be like

<form method="post" action="form.php">
<input type="checkbox" name="option[]" value="value 1" />
<input type="checkbox" name="option[]" value="value 2" />
<input type="checkbox" name="option[]" value="value 2" />
</form>

On the processing PHP page, the checked options are contained in an
array called $_POST['option']. You can run through all selected options
like this:

foreach ($_POST['option'] as $value) {
echo $value; // This will print out all selected values
}

 

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

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