SQL PHP HTML ASP JavaScript articles and free scripts to download

PHP referrer URL of a page

Referrer is the URL from where the visitor has arrived to the page. If you have reached here by clicking a link from google.com then google URL is the referrer for you in this page. We can find out the referrer by using PHP. This is useful for the webmasters to know where from the traffic to the site is coming. Which advertisement campaign is successful and which is not. We will also know the keywords used by the visitors in different search engines to arrive at the site. Here is the simple code to know the referrer in PHP
$ref=@$HTTP_REFERER;
echo "<font face='Verdana' size='3'><b>
Referrer of this page  = $ref </b>";
This is the code and here is your referer to this page


Same way you can find out the ip address of visitors to your site by using PHP. Click here to know the IP address by using PHP.

Getting referrer URL in ASP


Some of the browsers setting can be changed to stop the browser from sending any referrer information. Read here to know how you can change the settings for FireFox browser for referrer.

IP Address of Visitor in PHP.


Google+
jayanta10-02-2010
Not working
Colin17-02-2010
It doesn't work for me either...

but this does:

$ref = $_SERVER['HTTP_REFERER'];
Sumit Joshi11-03-2010
Great...Fully Working for Me.
Great help... Since long time I was looking for this. You are great...

Thanks again
jeremy28-03-2010
This is very bad advise,

This code will only work when the php.ini setting register_globals is set to on. Having register globals set to on is a security risk and is normally set to off on modern hosting platforms. The use of the error suppression operator '@' is also a concern. You should use somthing like $ref = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
Wayne12-05-2010
@jeremy
The outer parentheses wrapping "isset" aren't necessary, are they?
Money26-05-2010
$_SERVER['HTTP_REFERER'] is working well
Fernando04-06-2010
Thanks!
But, how get refereer's page title?
bakke06-06-2010
Don't take it that these variables are always "there". Use isset to avoid a PHP notice which (when many) can slow site performance down.
will08-06-2010
is there a way to format the output? sorry i have to type out the slashes cause the post thinks i am putting a link in the post...

anyhow $_SERVER['HTTP_REFERER']; gives output with the h t t p:slashslash/sitethatreferred.com can you format it to be without the h t t p: and just be sitethatreferred.com only? Does anyone know how to format the output? Thanks!
Stephin11-09-2010
yes..working.........superb site for php learners...:) nice one
Herbie25-01-2011
@ will:
just use $ref = substr($ref, 7);
Khuram23-07-2011
Sir,i want a function when user come into my site using any REFERER a mail will be send at to my email :)note only for REFERER not for all user
Yuksel21-02-2013
is it possible to get e-mail address when a link (to my server) in an e-mail clicked by php code?
subhendu22-02-2013
If the link contains any tracking code or email address then we can get the email address. This is what spam email links does. Even images src address submit a tracking code which says that the email address is valid one.
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer