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.

ASP.NET Forum


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



Reply
Using HTTP_REFERER to send an URL to a friend
Old 05-24-2006, 07:42 PM Using HTTP_REFERER to send an URL to a friend
Super Talker

Posts: 116
Trades: 0
Hi all,

I was going to write my send to a friend form in PHP but the website I'm doing this for is being programmed in ASP.

Here's the situation...

I have a newsletter with an article. There is a "send to a friend" link on there that is directing the reader to a page with a form on it to send the URL they were just reading.

I'm writing the form page in XHTML. It has the basic fields plus the following hidden field...

<input type="hidden" name="URL" value="<%= Request.ServerVariables('HTTP_REFERER')%>" />

Now, I have to use single quotes in the value field or else I'll get an error on the HTML side.

After the reader puts in their friend's email, their own and a short message, I then have a "submit" button that calls send.asp that creates the email.

objCDO.Body = strFrom & " has recommended that you check out " _
& "this article in Atlas Plugged." _
& vbCrLf & VbCrLf & Request.Form("URL") _
& vbCrLf & VbCrLf & Request.Form("Message")

When I receive the email (I'm testing on me), what I'm getting is... the <%= Request.ServerVariables('HTTP_REFERER')%> in the message.

HELP!!! What am I doing wrong? I heard that some browsers don't support the ASP Http_referer. I tried this with IE6 and Mozilla and get the same results.

Thanks
Donna
DonnaZ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-24-2006, 07:46 PM Re: Using HTTP_REFERER to send an URL to a friend
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
sounds like the form page doesn't have a .asp extension.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-25-2006, 10:52 AM Re: Using HTTP_REFERER to send an URL to a friend
Super Talker

Posts: 116
Trades: 0
Chris,

You are a genius. At 4am I looked up at the ceiling and said, I bet I didn't save the darn thing with an .asp extension.

Sure enough, I kept it as htm. I use FrontPage just for coding as I type everything (can't get into the Dreamweaver interface - it drives me nuts).

I guess I saved the page as .htm.

Thanks again. Boy do I feel like a dope. Believe me... I'll have better questions.

DonnaZ
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 05-27-2006, 04:24 PM Re: Using HTTP_REFERER to send an URL to a friend
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
heh we've all done that.

DonnaZ, a little piece of advice: what you may want to do is get a colour-coded text editor not named Fr*ntP*g* (yes, I know FP is WYSIWYG...it's one of the reasons I hate it).

Anyway, do that, and make sure your HTML and ASP colour templates use two different colour schemes. This will allow you to determine how the file is saved when you save it...if you see the HTML colour scheme, it's saved as HTML. The ASP scheme indicates that it's saved as ASP.

Easy, eh?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Using HTTP_REFERER to send an URL to a friend
 

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.25865 seconds with 12 queries