/    Sign up×
Community /Pin to ProfileBookmark

Form processing with PHP

Hello,

My objective is to pre-process a checkout form before HTTP POST, depending on 2 options: Home delivery or Self collection. For Home Delivery I’ll display specific details on the checkout form that won’t be displayed if the other option is selected.

There is probably a way with PHP, to retrieve the current value of a selected menu option on the form, pass it to a PHP variable to present the form in its relevant context, before posting it ? How would you do that ?

Thanks for your feedback.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@moondanceJun 21.2004 — it might be more helpful if you post your form.

From what i gather your saying, you want php to check if a form variable is one value or another, then display the appropriate output.

So if you have a textbox called "txtDeliveryOption", when you submit the form you will have a variable called $_POST['txtDeliveryOption'].

So if the user enters "Home Delivery" in the textbox, then :

$_
POST['txtDeliveryOption'] = "Home Delivery"

The same applies to checkboxes, radio and listboxes.
Copy linkTweet thisAlerts:
@philerimosauthorJun 22.2004 — Yes, no problem if I post. Just wanted to find a way to make the form more interactive based on preliminary choices made by the user before posting. I thought there was a way to capture the currently "selected" state of a particular menu option and possibly build a PHP function to render the HTML in each case...

Phil
Copy linkTweet thisAlerts:
@ShrineDesignsJun 22.2004 — it can, you just have to submit the form everytime
×

Success!

Help @philerimos 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.15,
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,
)...