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
php - save the referring site's url
Old 02-08-2012, 10:38 AM php - save the referring site's url
Average Talker

Posts: 23
Name: paul
Trades: 0
I’d like to save the referring page to my site – only external sources and then pass it in a session to another page where I log this url.
My site uses the index.php file to connect to all pages of the site (like a global include). So my problem is that I do record the referring url, but it is erased if a user passes from page to page – my script writes the previous page, instead of just saving the entrance url and that’s it.

Anyone can help here?
datrader is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-08-2012, 11:54 AM Re: php - save the referring site's url
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Get referrer

IF referrer not this site
write to cookie
ELSE
NULL
END-IF
__________________

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


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 05-18-2012, 05:43 PM Re: php - save the referring site's url
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by meochain View Post
A reference page is much simpler to write than a resume or cover letter, but don't overlook its importance.
You are on the third planet, orbiting a red dwarf star in the approximate centre of the Milky Way, about 26,000 light years from the galactic centre.

Which one are you from??
__________________
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 05-22-2012, 09:39 PM Re: php - save the referring site's url
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
Quote:
Originally Posted by PaulW View Post
Get referrer

IF referrer not this site
write to cookie
ELSE
NULL
END-IF
Specifically:

PHP Code:
<?php
$referer_ipv4
=gethostbyname(basename($_SERVER['HTTP_REFERER']));
$server_ipv4=($_SERVER['SERVER_ADDR']=='::1')?'127.0.0.1':$_SERVER['SERVER_ADDR'];
if(
$referer_ipv4!=$server_ipv4)setcookie('referring_url',$referer_ipv4,time()+86400);
?>
Sadly, that took much longer than I thought it would. Tested only on localhost, though, as you may be able to tell.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php - save the referring site's url
 

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