Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
form action depending on drop down selection
Old 12-19-2009, 02:37 PM form action depending on drop down selection
borzoid's Avatar
Webmaster Talker

Posts: 526
Name: Connie Taylor
Trades: 13
Hi - I need to create a form that will pass information to different pages based on the value of the item selected in one of the dropdown boxes.

The form will have two fields the first is to select the state from a dropdown. The second field is to select the type of insurance they are searching for (home,auto, life, health). There will be a separate search and information page for each of these types of insurance.

So if they select "auto" the action will be auto.php and if they select "health" the action will be health.php

This will be put inside a wordpress site (php) and will be directing to various wordpress pages. Could someone point me to a clean "current" script what would do the job? I really appreciate it.

Connie
borzoid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-19-2009, 02:47 PM Re: form action depending on drop down selection
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Just redirect in the target page
PHP Code:
<?php
$targ 
$_POST['option'];

switch (
$targ) {
    case 
"auto":
        
// redirect to auto page
        
break;
    case 
"home":
        
// redirect to home page
        
break;
    case 
"life":
         
// redirect to life page
        
break;
    case 
"health":
         
// redirect to health page
        
break;
     }
?>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-19-2009, 03:53 PM Re: form action depending on drop down selection
borzoid's Avatar
Webmaster Talker

Posts: 526
Name: Connie Taylor
Trades: 13
looks easier than I thought. How would this be incorporated into the form and would it effect any other actions in the wordpress code.

thanks again
borzoid is offline
Reply With Quote
View Public Profile
 
Old 12-19-2009, 05:20 PM Re: form action depending on drop down selection
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It doesn't go in the form, but on the page that receives the submission.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-19-2009, 05:55 PM Re: form action depending on drop down selection
borzoid's Avatar
Webmaster Talker

Posts: 526
Name: Connie Taylor
Trades: 13
thank you very much
borzoid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to form action depending on drop down selection
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23831 seconds with 12 queries