Reply to Problem with select...

Your name:

Reply:


Posted by Leszek on 02/02/06 00:22

I've got a form with a select list:
<select name="$dane[$idhotelu][$pomocnicza][$k]">;

After "submit"
$_POST['$dane'][$idhotelu][$pomocnicza][$k] contains the selected value -
Am I right??

I have a problem ith this code:

echo"<select name=\"\$dane[$idhotelu][$pomocnicza][$k]\">";

for($i=0;$i<=$nrooms;$i++)
{
echo "<option value=\"$i\"";
if($POST['$dane'][$idhotelu][$pomocnicza][$k]==$i){
echo" selected>$i</option>\n";
}
else {
echo">$i</option>\n";
}//endif
}//endfor
echo"</select>";

Even if I do something like this:
$dane[1][$pomocnicza][0]=1

This seems to be true for $i=0:
if($POST['$dane'][1][$pomocnicza][0]==$i){

"if" condition is true for $i=0 I have no idea why...
Is it because after submit form is reloaded?

What i wanted to get is that if user select "1" from dropdown list then
after reloading this form "1" will be selected value...

Thank for any ideas.

Leszek

[Back to original 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

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