variable http referrers $http_referrer = getenv( "HTTP_REFERER" );

This is a discussion on variable http referrers $http_referrer = getenv( "HTTP_REFERER" ); within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I have made next sendmail.php (modification from varius free internet scripts) and I want to add the variable to ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-20-2003
station
 
Posts: n/a
Default variable http referrers $http_referrer = getenv( "HTTP_REFERER" );

I have made next sendmail.php (modification from varius free internet scripts)
and I want to add the variable to knw the visitor's ip address, but I dont know
how..
Could you help me anyone, whon knows to add this variable at next php sendmail
script?

Thank you very much
(I'm newbie at php and programming - and I ' m need more details :-))

With next contact script I am collect email + whosentyou+whodontsentyou+message
(and I want the http referrers)
----------------------------------
<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.test.gr/members/sendmail.html" );
}
elseif (empty($email) || empty($whosentyou)) {
?>

<html>
<head><title>Σφάλμα</title></head>
<body>
<center><h1>Σφάλμα</h1></center>
<p><center>
Ουουπς, ξεχάσατε να συμπληρώσετε είτε την email address σας είτε κάποιο άλλο
πεδίο. <br>
Παρακαλούμε πατήστε το πλήκτρο BACK του προγράμματος περιήγησης <br>και
δοκιμάστε ξανά.
</center></p>
</body>
</html>

<?
}
else {
mail( "webmaster@test.gr", "Αίτηση για πρόσβαση στη σελίδα της νομοθεσίας",
"$message\nΑπό πού πληροφορηθήκατε για το σιτέ μας? $whosentyou\n\nΑπό πού δεν
πληροφορηθήκατε για το σιτέ μας? $whodontsentyou\n",
"From: $name <$email>" );
header( "Location: http://www.test.gr/eyxaristoume.htm" );
}
?>


Reply With Quote
  #2 (permalink)  
Old 07-23-2003
Ron
 
Posts: n/a
Default Re: variable http referrers $http_referrer = getenv( "HTTP_REFERER" );

"station" <station@gamebox.net> wrote in message
news:bff5a0$4cc$1@nic.grnet.gr...
> I have made next sendmail.php (modification from varius free internet

scripts)
> and I want to add the variable to knw the visitor's ip address, but I dont

know
> how..
> Could you help me anyone, whon knows to add this variable at next php

sendmail
> script?
>
> Thank you very much
> (I'm newbie at php and programming - and I ' m need more details :-))
>
> With next contact script I am collect email +

whosentyou+whodontsentyou+message
> (and I want the http referrers)
> ----------------------------------
> <?
> $email = $_REQUEST['email'] ;
> $message = $_REQUEST['message'] ;
> if (!isset($_REQUEST['email'])) {
> header( "Location: http://www.test.gr/members/sendmail.html" );
> }
> elseif (empty($email) || empty($whosentyou)) {
> ?>
>
> <html>
> <head><title>Σφάλμα</title></head>
> <body>
> <center><h1>Σφάλμα</h1></center>
> <p><center>
> Ουουπς, ξεχάσατε να συμπληρώσετε είτε την email address σας είτε

κάποιο άλλο
> πεδίο. <br>
> Παρακαλούμε πατήστε το πλήκτρο BACK του προγράμματος περιήγησης <br>και
> δοκιμάστε ξανά.
> </center></p>
> </body>
> </html>
>
> <?
> }
> else {
> mail( "webmaster@test.gr", "Αίτηση για πρόσβαση στη σελίδα της

νομοθεσίας",
> "$message\nΑπό πού πληροφορηθήκατε για το σιτέ μας? $whosentyou\n\nΑπό

πού δεν
> πληροφορηθήκατε για το σιτέ μας? $whodontsentyou\n",
> "From: $name <$email>" );
> header( "Location: http://www.test.gr/eyxaristoume.htm" );
> }
> ?>
>


Hi Station

$_SERVER['REMOTE_ADDR'] is what you need for the client IP address

HTTP_REFERER returns the name of the webpage that the user came from to
reach your current page. ( a page with your link on) If the variable is
empty it means they typed in the URL themselves or the link was made by a
JavaScript function or similar that defeats the referer variable.

Cheers

Ron


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:04 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0