php - Choose option in select box by clicking URL -


sorry vague title - behavior i'm trying little difficult summarize.

i updating our company's website, , first thing changed create contact form, versus having of company email addresses exposed via mailto: link.

the contact form straightforward...name, sender's email address, message...and selectbox can choose email.

now, on other pages, still have few mailto: links specific activities. next thing i'd change these links point contact page.

what figure out way have url contact page pass variable "who email" select auto-populates right selection.

i.e. - if click on link job advertisement, populates human resources person. if want know hippa stuff, populates select person in charge of hippa. etc.

the current contact page utilizes php, thinking maybe interpreter set read value url.

edit:

so selectbox i'm using (shortened , names modified). i'm trying accomplish if click on link from, say, default.htm operations information - shoots contact.php, , selects "wayne" sendto list:

<select id="sendto" name="sendto">     <option id="jim" value="jim">jim, executive vice president</option>     <option id="wayne" value="wayne">wayne, vice president, chief operating officer</option>     <option id="chris" value="chris">chris, operations director</option>     <option id="val" value="val">val, communications center director</option>     <option id="kathy" value="kathy">kathy, client accounts director</option>  </select> 

try out

<input type="checkbox" value="steve" <?php echo $_get[ 'email' ] == 'steve' ? 'checked="checked"' : ''?> />steve 

this make checkbox, , if $_get variable email set steve, checkbox checked

and select

<select>     <option value="steve" <?php echo $_get['email'] == 'steve' ? 'selected="selected"' : '' ?>>steve</option> </select> 

for url, (notice above changed variables), have like

http://www.example.com/contact.php?email=steve


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -