Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
HOw to direct to email page and return
Old 11-04-2008, 10:10 PM HOw to direct to email page and return
Average Talker

Posts: 25
Trades: 0
When a site visitor is viewing page1.htm (for example), they will find a link for sending the webmaster (me) an email. When they click that link they are taken to page emailform.php and fill out the fields for return email, subject, and body. When clicking submit, the html opens page emailsend.php which sends the email.

Question: How can I automatically direct the user back to page1.html, or page2.html or what ever page where they clicked the email link.

Is there an HTML variable that I can grab that tells me the previous page?
If so, can I put the value of that variable somewhere such that the PHP scrip or the code in the next html page can get it and use it?

Thanks for your time
bkelly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-04-2008, 10:41 PM Re: HOw to direct to email page and return
rezzy's Avatar
Super Talker

Posts: 115
Location: in the interwebz
Trades: 0
Ok, html variable? No, this is going to require using PHP. You will need to use a cookie or a session variable. Then once the user has completed the email, use "location" to redirect them to the page they were just in... according to their cookie or session.
__________________

Please login or register to view this content. Registration is FREE

Resnodesigns
rezzy is offline
Reply With Quote
View Public Profile
 
Old 11-05-2008, 03:11 AM Re: HOw to direct to email page and return
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
or read the referrer field

$_SERVER["HTTP_REFERER"]
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-05-2008, 07:08 AM Re: HOw to direct to email page and return
rezzy's Avatar
Super Talker

Posts: 115
Location: in the interwebz
Trades: 0
Quote:
Originally Posted by chrishirst View Post
or read the referrer field

$_SERVER["HTTP_REFERER"]
or that... I actually didnt know that existed.
__________________

Please login or register to view this content. Registration is FREE

Resnodesigns
rezzy is offline
Reply With Quote
View Public Profile
 
Old 11-05-2008, 10:14 AM Re: HOw to direct to email page and return
Experienced Talker

Posts: 34
Trades: 0
The best way to do this is by using a header. You will want to us a conditional statement that first sends the email and the does the following:

header("location:/page1.html");

That will send the user when done to page1.html. Obviously you will want to switch the page1.html with whatever the page name actually is.
__________________

Please login or register to view this content. Registration is FREE
pingeyeg is offline
Reply With Quote
View Public Profile
 
Old 11-05-2008, 10:39 AM Re: HOw to direct to email page and return
Average Talker

Posts: 25
Trades: 0
From rezzy's siggie:
[quote]Php Blog
Resnodesigns [/QUOTE

I followed the link and like the entry on sending email. I would like to see you finish it up and describe how the user gets to the next page, how the email is sent, and how the user gets back to where they started.

I will play around with that, cookies, and pingeyeg's response on the header. I don't know what header does, but a Google will probably tell me.

Thanks for your time.

Edit, concept change:

My goal is to create a method for users to click and send email about my site. I finally had the thought that this would be nicer if the button popped up a new window for the email form. When the user clicks Submit and finishes the email, the new wondow closes and the user is back where they were. This provides the ability for the user to view they page they are commenting about. They can even copy/past phrases for reference.

Any thoughts on that? I'll goggle around and see if I can figure out how to do that.

Hmmm, I changed that "quote" in the brackets to uppercase three times now and it keeps getting changed back to lower case when I use Preview Changes. What is with that? Why does lowercase not work? Oh Well. Make it four tries.

Closure?
I implemented the new window concept and it works well. I have many pages to write and new concepts to learn. Thanks for all the help on this thread.

Last edited by bkelly; 11-06-2008 at 12:49 PM.. Reason: resolved
bkelly is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HOw to direct to email page and return
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41306 seconds with 12 queries