Jump to content

Code for IP harvest needed


MsSummer

Recommended Posts

I had a line of code in a registration form years ago. I lost access to the server while in a coma for two years. Now I'm back and need the code.

 

When people fill out the registration form for a Wordpress blog, the info is emailed tto me. I used to get their IP at the end of the form. I need that line of code to parse (I think that's the right terminology) their IP onto the end of their registration.

Link to comment
https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/
Share on other sites

Ignace, duh???  IF I could just email someone for access, don't you think I could have thought of that?? :)  My business was sold while ill so although I have the server info, the pass isn't under my email.  Otherwise I'd get access and put 70+ websites back up.

 

Brentman -- thank you!  What format do I put that in?  I've lost memory so can't code anymore (yes, I appear stupid now but used to write scripts in PHP) and know there is a <?php or something in front of it.  I can't retain memory now or I'd start to relearn coding.

Thanks.  It's all Chinese to me basically.  I spent years learning to code PHP, HTML, etc but now it is just foreign to me.  Or if it looks familiar, I forget it after a bit.

 

I did a little research.  Please correct me if I'm wrong.  At the end of my WordPress user registration form I'll add this:

 

<?php
echo "
$ip = $_SERVER['REMOTE_ADDR'];";
?>

 

When the reg is emailed to me, the last line will be the IP of the person submitting.

Thank you.  I need the <? php etc before/after as well?  {I'm tempted to hire a h4cker to grab the old file j/k}

 

 

No you'll need to echo out the $ip variable. Othwerwise it'll just echo the string $ip = $_SERVER['REMOTE_ADDR']; as-is.

$ip = $_SERVER['REMOTE_ADDR'];
echo $ip; // this will echo out the IP

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.