Reply to Re: select box

Your name:

Reply:


Posted by Geoff Berrow on 01/11/07 16:02

Message-ID: <oulcq2d6sqq1c2oovj6g4lp2jk9ep95c4o@4ax.com> from Peter
revera contained the following:

>>How are you passing the variable?
>>Should be like this:
>>www.example.com?listid=someid
>
>Yep.
>
>edit_item.php?listid=68
Works for me

http://www.ckdog.co.uk/test/urlselect.php?listid=3
http://www.ckdog.co.uk/test/urlselect.php?listid=2

used an array to simulate your database call

$items=array(1=>"Item1",2=>"Item2",3=>"Item3",4=>"Item4");

echo "<select name=listid' class='gradientform'>\n";
foreach($items as $itemid=>$item){
$selected=(isset($_GET['listid']) &&$_GET['listid']==$itemid)?"
selected":"";
echo "<option value='$itemid'$selected>$item</option>\n";
}
echo "</select>\n";


--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

[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

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