Codeasearch.com - Search your code with us Login | Register | Contact us
  Forums > Php > dropdown list
balaji
Posted on Mar 2, 2009
Join Date: February 2009
Location: India ( chennai )
Posts: 9
 
dropdown list  

how to select values of a dropdown using php to my redirect page

benaya
Posted on Mar 3, 2009
Join Date: June 2007
Location: India ( Chennai )
Posts: 90
 
RE : dropdown list  

Hi,
Here is the sample code how to fetch querystring and check in select tag. Just pass the querystring like.

http://yourdomain.com/yourpage.php?selCategory=2

<select name="selCategory">
<?php for($intI=1;$intI<=5;$intI++) { ?>
<option <?php if($intI==$_REQUEST["selCategory"]) { ?>selected<? } ?> value="<?=$intI?>"><?=$intI?></option>
<?php } ?>
</select>

 Hot Discussion
Go Tech launches Android tablet for Rs 3,999...
Sony targets retailers with quick sales pitches and rew...
Share and discover new activities with Google Schemer...
Samsung gets 9 mn preorders for Galaxy S3: Report...
Google revamps search engine to think like a person...
 
 Discussion Topics
IT News
Php
Javascript
Technology Updates
Asp.Net
MySql
Ajax
Html
Fedora
Software Testing
Asp
Java
General
Flash
Ruby on Rails