Jump to content

Recommended Posts

Posted

Hi,

 

My client would like me to build a simple PHP form for viewers to select items they would like more information on. No problem. They would like the form to be pre-selected with an item they just selected on a previous page.

 

In other words, if they were looking at a vacation page describing a trip to vegas, and they click "buy now", (btw, there will be no shopping cart) or "more info", the subsequent form on the resulting page would have that vacation preselected.

 

This is requested in an effort to keep the clicks to a minimum for the user.

 

Couldn't this be done by attaching an "ID" to the "more info" button on what ever page they came from?

 

Your help is appreciated.

Posted

Yeah, using an ID is probably the easiest way. Pass the id in the URL

 

yoursite.com/form.php?id=2

 

and then in the form.php page, get the id from the URL using $_GET (make sure it is a valid int, otherwise people could edit the URL to add their own values instead) and use it to select the correct items.

  • 2 months later...
Posted

Thanks for your replies. I did end up passing an ID via the link and used the $_GET to both, show the "vacation" name visibly on the form, and also to pass the ID through the form data using a hidden input! :clap::)

 

So thanks for your help.

 

P.S.

 

@Ben - your logo is VERY cool!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...