Jump to content


Photo

help regarding IP address


  • Please log in to reply
3 replies to this topic

#1 vicky57t

vicky57t
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 18 May 2006 - 08:05 AM

hi all,

i built a small app in php & mySql which resides on an apache server with gentoo linux.

I use it on my local network to post knowlwdgebase entries & solutions from simple webpage with textboxes & text areas.

what I want is some way in PHP code from whcih I can get the IP address of people entring data in the tables thru the application and maybe get the entry in my database.

Kindly help


thanks


#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 18 May 2006 - 08:16 AM




$_SERVER['REMOTE_ADDR'] will be useful for you
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------

#3 echoninja

echoninja
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 18 May 2006 - 10:10 AM

to expand on what samshell said, in your when you send your info from the form to the database just simply do this
$ip=$_SERVER['REMOTE_ADDR'];

and then just add it into the INSERT like the rest of the data :)

#4 vicky57t

vicky57t
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 18 May 2006 - 10:33 AM

[!--quoteo(post=374888:date=May 18 2006, 01:46 PM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ May 18 2006, 01:46 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
$_SERVER['REMOTE_ADDR'] will be useful for you
[/quote]



THANX A LOT [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

[!--quoteo(post=374898:date=May 18 2006, 03:40 PM:name=EchoNinja)--][div class=\'quotetop\']QUOTE(EchoNinja @ May 18 2006, 03:40 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
to expand on what samshell said, in your when you send your info from the form to the database just simply do this
$ip=$_SERVER['REMOTE_ADDR'];

and then just add it into the INSERT like the rest of the data :)
[/quote]


Thanks a LOT [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users