MsSummer Posted September 22, 2013 Share Posted September 22, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/ Share on other sites More sharing options...
ignace Posted September 22, 2013 Share Posted September 22, 2013 Do a "forgot password" or contact your hosting company to get your credentials. If you are paying for the hosting this should be no problem. Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450629 Share on other sites More sharing options...
DFulg Posted September 22, 2013 Share Posted September 22, 2013 Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450657 Share on other sites More sharing options...
brentman Posted September 22, 2013 Share Posted September 22, 2013 I think you want this: $ip = $_SERVER['REMOTE_ADDR']; Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450719 Share on other sites More sharing options...
MsSummer Posted September 22, 2013 Author Share Posted September 22, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450722 Share on other sites More sharing options...
cyberRobot Posted September 23, 2013 Share Posted September 23, 2013 You might want to review the basics of PHP here: http://php.net/manual/en/language.variables.basics.php Also, information on the $_SERVER variable can be found here: http://php.net/manual/en/reserved.variables.server.php Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450809 Share on other sites More sharing options...
MsSummer Posted September 23, 2013 Author Share Posted September 23, 2013 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: <?phpecho "$ip = $_SERVER['REMOTE_ADDR'];";?> When the reg is emailed to me, the last line will be the IP of the person submitting. Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450914 Share on other sites More sharing options...
AbraCadaver Posted September 23, 2013 Share Posted September 23, 2013 No, you would add: $_SERVER['REMOTE_ADDR'] to whatever variable contains the rest of the email message. Maybe $message or something like that. Post the email message code and it should be easy. Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450919 Share on other sites More sharing options...
Ch0cu3r Posted September 23, 2013 Share Posted September 23, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450920 Share on other sites More sharing options...
MsSummer Posted September 23, 2013 Author Share Posted September 23, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450923 Share on other sites More sharing options...
Ch0cu3r Posted September 23, 2013 Share Posted September 23, 2013 Yes all php code needs to be enclosed in <?php and ?> tags Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450926 Share on other sites More sharing options...
MsSummer Posted September 23, 2013 Author Share Posted September 23, 2013 Again, thank you. In time I hope to get back to coding! Quote Link to comment https://forums.phpfreaks.com/topic/282352-code-for-ip-harvest-needed/#findComment-1450938 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.