CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> Archive -> GotoCode Archive

 mail IP-adress

Print topic Send  topic

Author Message
Johnny Van Bogaert
Posted: 12/28/2003, 11:07 AM

I have made a form, after a visitor has filled in the form, I receive a mail with all the content.

But now I want to catch the visitors IP, so I can ban people who think it is funny to send fake e-mails.

I have tried to use in my Codecharge generated PHP:
but I don't get the information.

Maybe I put it in the wrong place, maybe i Forgot something.

Who can help me!!!

Posted: 12/28/2003, 2:00 PM

You really can't test a specific IP address as they are dynamically allocated by an ISP.

Your best bet is to get them to login with their Email address and you send them a password. For corporate or secure info I also ban all hotmail addresses.

Good luck.
P.S. Please use Codecharge's new forum as this one will close soon
Posted: 12/28/2003, 2:18 PM

$visitorIP = $_SERVER['REMOTE_ADDR'];
echo('data = ' $visitorIP);

try this, works for me on PHP 4.3.x
$http_server_vars...... is 4.0 and earlier I think.
Walter, NL
Johnny Van Bogaert
Posted: 12/30/2003, 12:12 AM

When I use VisitorIP = $_SERVER['REMOTE_ADDR']; in a selfmade PHP it works.
But when I put it into an CodeChargemade PHP it doesn't work!!!!

I have put it under

// info Insert Event begin


$email = "";
$subject = "blablaababablbabla";
$body = "This is the IP-address: " . VisitorIP;

mail($email, $subject, $body, $headers);

// info Insert Event end

I don't understand why this doesn't work!!!

Please help me!

Johnny Van Bogaert
Posted: 12/30/2003, 1:51 AM

Instead of $VisitorIP = $_SERVER['REMOTE_ADDR'];
try this:

global $REMOTE_ADDR;
$VisitorIP = $REMOTE_ADDR;
echo $VisitorIP;
or directly



These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.