Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-22-2012, 05:41 PM   PM User | #1
webjoker
New Coder

 
Join Date: Jan 2012
Location: Sweden
Posts: 32
Thanks: 7
Thanked 0 Times in 0 Posts
webjoker is an unknown quantity at this point
Jump back to index.html after sending a email - possible?

Hello there,

I want to make an email form where you type your "email", "subject" and your "message" (of course). Then (when you clicked on submit button) i want a message to appear on the screen which says something like "Thank you for sending a message.You will soon return to starting page". And for the last part i want to them to be sent back to index.html

And then my question is, how do i make that last part work? I have already done the form and message to appear on the screen. But i have no clue how to make the last part. It would be awesome if i could make them stay at the message for 7 secs or something like that and THEN they will return back to index.html. Any suggestions? I would love to hear them and i hope you can help me out!

Regards: Webjoker
webjoker is offline   Reply With Quote
Old 01-22-2012, 05:50 PM   PM User | #2
coding_begins
Regular Coder

 
Join Date: Aug 2011
Posts: 134
Thanks: 20
Thanked 0 Times in 0 Posts
coding_begins is an unknown quantity at this point
This will wait for 5 seconds before redirecting it to a new page..
<?php header("Refresh: 5;url=http://www.yourdestination.com/"); ?>
echo "You will now be redirected to a new page, after 5 seconds.";
exit();
?>
Place after you have done all the processing (insert,send or whatever u wish to do)..
coding_begins is offline   Reply With Quote
Old 01-22-2012, 05:50 PM   PM User | #3
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,504
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
You need a meta refresh. Google it.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Users who have thanked tangoforce for this post:
webjoker (01-22-2012)
Old 01-22-2012, 08:54 PM   PM User | #4
webjoker
New Coder

 
Join Date: Jan 2012
Location: Sweden
Posts: 32
Thanks: 7
Thanked 0 Times in 0 Posts
webjoker is an unknown quantity at this point
Ah, thank you Tangoforce. Exactly what i wanted and it works fine!
webjoker is offline   Reply With Quote
Reply

Bookmarks

Tags
email, index, message, return, send

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:57 PM.


Advertisement
Log in to turn off these ads.