/    Sign up×
Community /Pin to ProfileBookmark

Run selected php file with radio button…?

Hi guys,

I have text field, 2 radio button (subscribe & unsubscribe) in html file.
Now if the user select subscribe radio button I want to run subscribe.php and if select unsubscribe radio button I want to run unsubscribe.php….

How can I do it?

Thanks in advance
Jack

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@jasonahouleJun 18.2007 — You can use javascript to change the form action i.e. document.forms['myForm'].action = ""

Or you could just submit it to the same page and use php to test which radio button is checked.
Copy linkTweet thisAlerts:
@jack001authorJun 18.2007 — thats wat i wanna know, how php will check?

You can use javascript to change the form action i.e. document.forms['myForm'].action = ""

Or you could just submit it to the same page and use php to test which radio button is checked.[/QUOTE]
Copy linkTweet thisAlerts:
@jasonahouleJun 18.2007 — if($_POST['radio1'] == "value1") {

// do something here

} else if ($_
POST['radio2'] == "value2") {

// do something else

}
Copy linkTweet thisAlerts:
@jack001authorJun 19.2007 — thanks a ton

u solved my problem

god bless u

regards

Jack

if($_POST['radio1'] == "value1") {

// do something here

} else if ($_
POST['radio2'] == "value2") {

// do something else

}[/QUOTE]
×

Success!

Help @jack001 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...