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.

PHP Forum


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



Freelance Jobs

Reply
detect referral url and redirect/popup window
Old 12-02-2009, 09:35 AM detect referral url and redirect/popup window
Average Talker

Posts: 22
Name: Rikesh Bajracharya
Trades: 0
hi i was wondering if there is any script that could pop up different content window for different refferal links.
like if site1.com sends me a visitor to mysite then page1.php pop's up
and if site2.com sends me a visitor to mysite then page2.php pop's up??
is there anykind of script???

can anyone here help??
easyflashgames is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-02-2009, 09:38 AM Re: detect referral url and redirect/popup window
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
$_SERVER['HTTP_REFERER']
http://www.php.net/manual/en/reserve...les.server.php
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-02-2009, 09:49 AM Re: detect referral url and redirect/popup window
Average Talker

Posts: 22
Name: Rikesh Bajracharya
Trades: 0
thanks chrishirst,
im really new to php so coding :S
does anyone has made this kind of script??
easyflashgames is offline
Reply With Quote
View Public Profile
 
Old 12-02-2009, 09:54 AM Re: detect referral url and redirect/popup window
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
There's a few
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-02-2009, 10:03 AM Re: detect referral url and redirect/popup window
Average Talker

Posts: 22
Name: Rikesh Bajracharya
Trades: 0
i found this one. but i think this one will not pop up a window?? how can i make it pop up a window???
Code:
<?
  $referrer = $_SERVER['HTTP_REFERER'];
  if (preg_match("/site1.com/",$referrer)) {
        header('Location:  http://www.customercare.com/page-site1.html');
  } elseif (preg_match("/site2.com/",$referrer)) {
        header('Location:  http://www.customercare.com/page-site2.html');
  } else {
        header('Location:  http://www.customercare.com/home-page.html');
  };
  ?>
easyflashgames is offline
Reply With Quote
View Public Profile
 
Old 12-02-2009, 10:07 AM Re: detect referral url and redirect/popup window
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You can't from PHP, you would have to send javascript to the browser that triggered a pop-up which would of course promptly be blocked by most browsers.
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-02-2009, 10:11 AM Re: detect referral url and redirect/popup window
Average Talker

Posts: 22
Name: Rikesh Bajracharya
Trades: 0
if i put this script on a third page on my site will it still know the first refferal??
like if i get a visitor from site1.com to mysite.com and then the user goes to mysite.com/page1.php where this code is kept then will it still get the previous refferal as site1.com and then redirect.
easyflashgames is offline
Reply With Quote
View Public Profile
 
Old 12-02-2009, 10:15 AM Re: detect referral url and redirect/popup window
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
then you have to store it in a cookie or in a session value and read that on subsequent pages
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-02-2009, 10:37 PM Re: detect referral url and redirect/popup window
Average Talker

Posts: 22
Name: Rikesh Bajracharya
Trades: 0
thanks chrishirst

i have began coding it almost 50% done. thanks for ur info. after i finished it i will post the code here.

thanks.

Last edited by easyflashgames; 12-03-2009 at 12:26 AM..
easyflashgames is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to detect referral url and redirect/popup window
 

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