Jump to content


Photo

Getting IP from form


  • Please log in to reply
17 replies to this topic

#1 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 05 July 2006 - 05:42 PM

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?

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 05 July 2006 - 06:03 PM

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.

#3 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 05 July 2006 - 06:56 PM

Which one of the files and how do I format it to get the IP using this?

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 05 July 2006 - 06:59 PM

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?

#5 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 05 July 2006 - 07:43 PM

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]

#6 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 12:56 PM

bump for reply?

#7 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 06 July 2006 - 01:01 PM

a) post some actual code, not some file to download. 
b) you don't really need to pass the ip address through your form, since it is a variable automatically created whenever a script is called. wildteen88 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 wildteen88 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? 
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#8 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 01:22 PM

The code is above in a download.

Look up there are several files.

#9 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 06 July 2006 - 01:31 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#10 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 06 July 2006 - 02:19 PM

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.


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?

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#11 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 03:46 PM

I cannot post the code cause the forum says the following when i try:

The following error or errors occurred while posting this message:
The message exceeds the maximum allowed length (40000 characters).


Thats why I did it in a file.

#12 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 06 July 2006 - 03:50 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#13 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 03:57 PM

Ok which part is the "relevent part that is needed and I will post that.

I have:
class.phpmailer
config1152128398.php
form1152128398.php
inc_mail.php
process1152128398.php

All these performt he mail action..Which one can I post for you ?


#14 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 06 July 2006 - 03:59 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#15 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 04:01 PM

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.

#16 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 04:02 PM

And one other thing if you cant help dont bother replying cause your just sitting here bashing me cause you dont know

#17 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 06 July 2006 - 04:06 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#18 john510

john510
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 06 July 2006 - 04:08 PM

Thanks for the help.. I just found another forum thats helping me.. Thanks again.. Goodbye..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users