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
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.