Forum Moderators: mack

Message Too Old, No Replies

Life after the Submit button

How to take a user to another page after a submission

         

djkit

9:50 am on Jul 7, 2005 (gmt 0)

10+ Year Member



Hi There,

I have a simple form with a submit button, I have finally managed to get it to send the email (using java) but I would like to display a page after the user clicks select, which would say, thanks for submitting the form...)

Anyone know how I can do that....? :)

Thanks

Dijkgraaf

1:02 am on Jul 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A search for Java Response Redirect might give you want you are looking for.

Tomness

4:18 pm on Jul 12, 2005 (gmt 0)

10+ Year Member



You could set it to php with some really simple coding and then use some strings, and echos and other simple things to make a confirmed page.

I use them in a couple of my websites - they work a treat, and you wouldn't have to be greatly experienced with php to understand.

I'll use a small example of the code I use for my mailing list page.

mailinglist.html

<form action="index.php?get=mailinglist.php" method="POST">
<input class=textarea name="email" size="40">
<input class=button type="submit" name="submit" value="Join">
</form>

Then, as you know, once the user has submitted their information they're redirected to the page stated - in this case 'mailinglist.php'

mailinglist.php

<?
$email = $_POST['email']; // this gets their email from the previous page
$myemail = "myemail@mywebsite.co.uk"; // this is the email it is being sent to
mail($myemail, "email topic", "Email: $email"); // this is the topic of the email when recieved, and how it will appear
?>
<h1>Thank You:</h1>

//thanks message
<p>You are now sucsessfully added to the mailing list, thank you for joining.</p>

The way to set up what you see in the email is easy too.

You get what you want to see in the email and you get what they wrote, in the above I used the example.

Email: $email

So that will appear as

Email: theiremail@theirdomain.com

To add more is really easy, you just repeat the commands.

Example:
Email: $email\n Other Field: $other\n

\n represents a new line. In the recieved email you would see it as

Email: theiremail@theirdomain.com
Other Field: other thing?

I hope I have helped.