CodeCharge Studio
search Register Login  

Web Reports

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

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:
$visitorIP = $HTTP_SERVER_VARS['REMOTE_ADDR'];
but I don't get the information.

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

Who can help me!!!

Thanks
Edd
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.
Edd
[www.syntech.com.au]
P.S. Please use Codecharge's new forum http://forums.codecharge.com/ as this one will close soon
wkempees
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.
Greets,
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

VisitorIP = $_SERVER['REMOTE_ADDR'];

$email = "blablabla@blabla.be";
$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
feha
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
echo $REMOTE_ADDR;


regards
feha
[www.vision.to]

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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