john510 Posted July 5, 2006 Share Posted July 5, 2006 Im using the form at http://www.eformmailer.com/ to create a from just an simple form with a name, but all so what to know the IP number of the person sending the form.Is there a way to add to this form the IP number of the person sending the form in the email sent? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/ Share on other sites More sharing options...
wildteen88 Posted July 5, 2006 Share Posted July 5, 2006 There is a predefined variable which stores the users IP address. $_SERVER['REMOTE_ADDR'] is the variable you want to use in order to retrieve the users IP Address.Note dont rely on this as users IP addresses can change frequently and can be easily changed. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53466 Share on other sites More sharing options...
john510 Posted July 5, 2006 Author Share Posted July 5, 2006 Which one of the files and how do I format it to get the IP using this? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53505 Share on other sites More sharing options...
wildteen88 Posted July 5, 2006 Share Posted July 5, 2006 I dont know! Kind of hard when theres no code to see. Post the code you current have here and I'll have look. Also where do you want the IP address to show up to? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53507 Share on other sites More sharing options...
john510 Posted July 5, 2006 Author Share Posted July 5, 2006 Here are the forms , dont know where to put the IP and no I dont want the ip to show to the user just it sent to the person gettingthe mail. There are several forms..[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53530 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 bump for reply? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53837 Share on other sites More sharing options...
.josh Posted July 6, 2006 Share Posted July 6, 2006 a) post some actual code, not some file to download. b) you don't really need to pass the ip address [i]through[/i] your form, since it is a variable automatically created whenever a script is called. [b]wildteen88[/b] already told you that variable's name: $_SERVER['REMOTE_ADDR']but if you insist on passing it through your form, you would pass it with a hidden field, something like this:<input type='hidden' name='ipaddress' value='<?php echo $_SERVER['REMOTE_ADDR']; ?>'>and then you could access it with $_POST just like any of your other variables (assuming you used the POST method).... or you could you know, just use $_SERVER['REMOTE_ADDR'] in the called script, as i just mentioned. c) I slightly disagree with [b]wildteen88[/b] on IP reliability. I will agree that in theory it is not advisable to rely soley on someone's ip/tcp level info because one's ip address could potentially change every http request, but in reality, it does not. And I will agree that someone could easily access your page via a different ip address intentionally. why do you want to track the user's ip? is it for security reasons? to verify they are who they are? as measures to prevent cracking attempt? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53841 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 The code is above in a download.Look up there are several files. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53847 Share on other sites More sharing options...
.josh Posted July 6, 2006 Share Posted July 6, 2006 what part of "post some code, not some file to download" do you not understand? Neither I nor anybody else is here to download and sort through whatever amount of files you happen to have. the example I gave you is more than ample information for you to sort through your own code. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53852 Share on other sites More sharing options...
tomfmason Posted July 6, 2006 Share Posted July 6, 2006 [quote author=Crayon Violent link=topic=99550.msg392497#msg392497 date=1152192719]what part of "post some code, not some file to download" do you not understand? Neither I nor anybody else is here to download and sort through whatever amount of files you happen to have. the example I gave you is more than ample information for you to sort through your own code. [/quote]Crayon Violent is right. You have already been told how to add it to the form. Now you need to post the mail script so that we may help you in adding it to the mail sent. Also, if it is a simple form to mail then you should realy have no need for the users ip. It is not being posted to a database. So what other possible uses could there be? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53879 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 I cannot post the code cause the forum says the following when i try:[b] The following error or errors occurred while posting this message:The message exceeds the maximum allowed length (40000 characters). [/b]Thats why I did it in a file. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53929 Share on other sites More sharing options...
.josh Posted July 6, 2006 Share Posted July 6, 2006 okay do you really think you need to post your entire code or just the relavent part. that's my point. nobody wants to read 40,000 lines of code for one simple thing. you already know what your code is supposed to do and where things already are, right? for example, you already know where in your code your form is, right? you already know where in your code the other variables are checked/inserted into your email right? adding the ip address to that list is as simple as adding that server variable to the list. nobody should have to go through 40k lines of code for that. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53937 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 Ok which part is the "relevent part that is needed and I will post that.I have:class.phpmailerconfig1152128398.phpform1152128398.phpinc_mail.phpprocess1152128398.phpAll these performt he mail action..Which one can I post for you ? Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53940 Share on other sites More sharing options...
.josh Posted July 6, 2006 Share Posted July 6, 2006 okay this obviously isn't your script that you made, seeing as how you don't seem to know anything about it. this forum is not for altering 3rd party scripts to fit your needs. i suggest you go ask whoever made your script. surely they must have their own forum. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53942 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 No as I said I went to the above site where you enter the data in but there was no option for the IP.I never said it was my script and you seem to come up with a idea i said it was. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53944 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 And one other thing if you cant help dont bother replying cause your just sitting here bashing me cause you dont know Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53945 Share on other sites More sharing options...
.josh Posted July 6, 2006 Share Posted July 6, 2006 i already did help you. i told you what variable to use that holds the user's ip address, and how to use it. and now, instead of bothering to try doing it yourself, you are wanting me (or someone else) to sort through fourty thousand lines of code to do it for you. that's not how it works around here. If you take my explaining all this to you as "bashing" then so be it. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53948 Share on other sites More sharing options...
john510 Posted July 6, 2006 Author Share Posted July 6, 2006 Thanks for the help.. I just found another forum thats helping me.. Thanks again.. Goodbye.. Quote Link to comment https://forums.phpfreaks.com/topic/13762-getting-ip-from-form/#findComment-53950 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.