RE: Customize link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If your options are dynamically created you could check the value passed
against each option are mark the match with "SELECTED";


Example Static:
Echo "<option value='5'"; If(isset($_GET['cat_id'])  && $_GET['cat_id'] ==
5){ echo ' SELECETED ';} echo " >5</option>".PHP_EOL;


Example Dynamic

for($a=1, $a <= 15; $a++)
{
Echo "<option value='".$a."' "; If(isset($_GET['cat_id']) && $_GET['cat_id']
== $a){ echo ' SELECETED ';} echo " > ".$a."</option>".PHP_EOL;
}


Just a though



Richard L. Buskirk

-----Original Message-----
From: Michael Simiyu [mailto:simiyu.michael@xxxxxxxxx] 
Sent: Thursday, May 05, 2011 6:10 PM
To: php-general@xxxxxxxxxxxxx
Subject:  Customize link

Hello,

Here is the scenario....

I have a form with the folloing fields  i. Title  ii. Category (This  
is a drop down with a list of categories which have id's - am using  
wordpress )  iii. upload file field

now what i want to do is to be able to customize a link like
http://www.mysite.com/addfile&cat_id=5 
  so that when i access the link it has one of the categories in the  
drop down selected......reason is i dont want users to see the  
different types of categories....

So i guess my question is how to configure a meu item in a drop down  
to be automatically selected in a link...

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux