473,394 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Linking back to specific referrer sites... How to?

Haitashi
There are many ways to reach my site. But I what I'm trying to accomplish is to test if the user comes back from 3 specific sites. If they are linking to my site from theirs, I want to store that info in a variable to dynamically create a URL that links back to that original site.

I was thinking that I could use CGI.http_referrer and somehow test if it contains specific URL info. And if it contains any of those 3 sites then save the content to a variable.

Can I even test of specific text exists as part of CGI.http_referrer? I also think that I need to test for the domain and have it completely ignore any sub directory (so that blabla.com & blabla.com/home/ would both come back as 'true' if I test it for the blabla.com string).

Any suggestions?
May 22 '08 #1
4 2643
acoder
16,027 Expert Mod 8TB
Use it as a string. Use a combination of string functions (find, refind, left, mid, etc.) or perhaps someone has already written a UDF over on cflib.org
May 23 '08 #2
Thanks. Even though your suggestion worked (I saved the referrer info and would do a find. If it found any piece of the URLs I needed, then it would set a variable to contain that info).

Even though in theory this should work. However, we would sometimes end up with unreliable information inside the referrer and this would cause errors. Mostly from users using the BACK and FORWARD button to navigate around.

I decided not to implement this feature until I find a safe and proved method to do it. Thanks anyways!
May 29 '08 #3
acoder
16,027 Expert Mod 8TB
Yes, cgi.http_referer is unreliable. It's even spelt incorrectly! The user can spoof or disable it or the firewall can block it. Not something that can be relied upon.
May 29 '08 #4
I've decided to abandon this idea for now. If I do find a reliable way, I'll post back.
Jun 10 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: George Hernandez | last post by:
I have a site on a set of Linux Servers where my site is PHP enabled and I would like to prevent people from externally linking to content on my site and replace it with a warning image. I've...
3
by: riotctrl | last post by:
Is there a way to use the history.back to display the actual url of the last page to the page ?
27
by: Lee Phillips | last post by:
I believe it is universally accepted that decorating your website with images from someone else's, without permission, is rude and unethical, even if the images are in the public domain, because...
1
by: paddy | last post by:
I keep digging through tut after tut and I find lots and lots of C++ logic, but I can't find any straight forward plain and simple info on the whole linking and library process. Can anyone...
2
by: Goober | last post by:
I have to determine the document.referrer of the individual coming to my site. I want to send everyone not coming from one of those sites to an alternate location (The names below are just used as...
5
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
2
by: Bishop | last post by:
I want to determine referrer website when someone comes to my page. Since the link URL has to be static between sites (i.e. I can't use something like mysite.com?refid=14 to determine who linked...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.