Jump to content

Form Submission Return Page


marshmarsh
 Share

Recommended Posts

<form method="post" action="webpage.php">this will mean that when the form is submitted it will load webpage.php and any thing within the form will be accessible to webpage.php by using $_POST.like <form method="post" action="webpage.php"><input type="text" name="name"><input type="submit" value="submit"></form>you could access the information they put in the textfield with $_POST['name']

Link to comment
Share on other sites

How do I send users to a particular web page after they have submitted a form? I've used the echo statement to send them to a page that says 'thank you' but I would like to send them to an actual nicely designed page.
I'm sorry I guess I didn't give enough information initially. I already have an action which is a php script that writes the form submission data to a mysql database. I would like to have it then take them to a different page, "thank you for subscribing..."
Link to comment
Share on other sites

you can do that on the same page. just have "thank you for subscribing" or whatever within a conditional statement after the database input... could be like if($subscribed == "TRUE"){ echo "Thank you for subscribing... etc.";}and you could put $subscribed = "TRUE";just under where you are inserting the database info

Link to comment
Share on other sites

Instead of simply outputting "Thank you..." I'd like to actually send them to a different url, perhaps www.mydomain.com/thankyou.html, which has consistent formatting with the rest of my site, instead of a blank white page that says 'thank you.' So how do I send the user to a different page? Thanks.

you can do that on the same page. just have "thank you for subscribing" or whatever within a conditional statement after the database input... could be like if($subscribed == "TRUE"){ echo "Thank you for subscribing... etc.";}and you could put $subscribed = "TRUE";just under where you are inserting the database info
Link to comment
Share on other sites

They were trying to say that you can put exactly what you want on your form processor page, it doesn't just need to be a white page, you can put whatever you want there to make it look like the rest of your site. If you just want to redirect, you can use a location header.header('Location: page.php');

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...