Re: Problem while accesing $_POST
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Problem while accesing $_POST

From: Erwin Moller <since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
Date: Tue Jan 31 2006 - 15:22:10 CET

Leszek wrote:

> Hi.
>
> I have a problem with a form.
> There are some select dropdown lists
> for($i=0;$i<=$nrooms;$i++)
> {
> echo "<option value=\"$i\"";
>
> if($_POST[$dane[$idhotelu]['zamow'][$k]]==$i){ // $k is

What is $dane[$idhotelu]['zamow'][$k] ??
You use it in a way that it should contain some string you expect to be in
the $_POST since you are trying to take that name/value pair from the
$_POST.
Are you sure it is correct?

If in doubt, just echo it on the same page from the HTML somewhere, like:
$dane[$idhotelu]['zamow'][$k] now contains:
<?= $dane[$idhotelu]['zamow'][$k] ?>

Regards,
Erwin Moller

PS:
<pre>
<? print_r($_POST); ?>
</pre>
might help too during debugging

> incremented in other loop
> echo" selected";
> }// endif
> echo">$i</option>\n";
> }//endfor
> echo"</b></select></td>";
>
> Trouble is that after reloading this form if condition is true for $i==0
> even if $dane[$idhotelu]['zamow'][$k] is not zero
>
> I think i'm making a mistake while accessing $_POST array but i' don't
> know where
>
> Thanks for help...
> Leszek
Received on Tue Feb 7 21:08:18 2006