prataprajesh Posted November 23, 2016 Share Posted November 23, 2016 Hello, The below is the code i have i want to track down the ipaddress of the people who ever subscribed to my list. I am beginner in php kindly do the needful. Thanks a lot in advance. <!-- Subscribe form --> <form action="subscribe/NLprocess.php" method="post"> <h6 class=footer-widget-heading>Enter your email:</h6> <div class="input"> <input type="text" class="button" name="email" placeholder="Email address"> <input type="submit" class="button" id="submit" value="Subscribe"> </div> </form> <!-- End subscribe form --> The processing file NLprocess.php ---- $emailmanager = 'smallstamps@gmail.com'; // SECOND: // save this file, and close it. Thank you! error_reporting(0); $email = trim($_POST['email']); $Ok = ereg("^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $email); if ($Ok) { mail($emailmanager,'Subscribe','','From: '.$email); if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm)) { ?> <script language = 'javascript'> alert('Thank you, Now you Subcribed to smallstamps.com Updates'); history.go(-1); </script> <? exit(); } } else { if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm)) { ?> <script language = 'javascript'> alert('Sorry, please provide a valid Email address.'); history.go(-1); </script> <? exit(); } } ?> Kindly let me know what i have to do to track the ip address. Quote Link to comment https://forums.phpfreaks.com/topic/302598-track-ip-for-subscription-form/ Share on other sites More sharing options...
Jacques1 Posted November 23, 2016 Share Posted November 23, 2016 You've copied and pasted the entire code (which is ancient, by the way), so why can't you copy and paste some IP script as well? Quote Link to comment https://forums.phpfreaks.com/topic/302598-track-ip-for-subscription-form/#findComment-1539588 Share on other sites More sharing options...
requinix Posted November 23, 2016 Share Posted November 23, 2016 You can get the IP address with $ipaddr = (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? /* proxy */ $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"]);Put that into the body of the email however you want. Quote Link to comment https://forums.phpfreaks.com/topic/302598-track-ip-for-subscription-form/#findComment-1539591 Share on other sites More sharing options...
prataprajesh Posted November 23, 2016 Author Share Posted November 23, 2016 I am so sorry, If i had IP script i would may done that as well , I felt some of the beginners like me in php could able to help me out if they have complete code where to insert the real code . Sorry to take you to the (ancient world ) Quote Link to comment https://forums.phpfreaks.com/topic/302598-track-ip-for-subscription-form/#findComment-1539592 Share on other sites More sharing options...
prataprajesh Posted November 23, 2016 Author Share Posted November 23, 2016 I am getting either HTTP ERROR 500 or please provide the vaild email address. Kindly do the needful. Quote Link to comment https://forums.phpfreaks.com/topic/302598-track-ip-for-subscription-form/#findComment-1539596 Share on other sites More sharing options...
Jacques1 Posted November 23, 2016 Share Posted November 23, 2016 Kindly do the needful. This is not a code-for-free service. requinix provided the relevant data, now it's your job to do some basic research and integrate the feature into your code. Of course we can help you with specific questions. But if you expect us to do the work for you, that won't happen, no matter how kindly you ask for it. Quote Link to comment https://forums.phpfreaks.com/topic/302598-track-ip-for-subscription-form/#findComment-1539599 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.