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
Navigation:
[Reply to this message]
|