Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. storing visitor IP address

storing visitor IP address

Scheduled Pinned Locked Moved Web Development
javaphphtmldatabasemysql
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sangeeta2009
    wrote on last edited by
    #1

    I want to store the IP address of visitor to my site in Mysql. I wanted to know if it is possible through HTML or JAVA, if yes then please help in code. If the only solution is PHP , then please tell me how can i work simultaneously work with JSP and PHP database code. As i am working on JSP coding, Please tell how to embedded the php code and use it. Don't know PHP. Please help

    L 1 Reply Last reply
    0
    • S sangeeta2009

      I want to store the IP address of visitor to my site in Mysql. I wanted to know if it is possible through HTML or JAVA, if yes then please help in code. If the only solution is PHP , then please tell me how can i work simultaneously work with JSP and PHP database code. As i am working on JSP coding, Please tell how to embedded the php code and use it. Don't know PHP. Please help

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Check the link http://www.rgagnon.com/javadetails/java-0363.html[^] This may help you

      Regards Aman Bhullar www.arlivesupport.com[^]

      A 1 Reply Last reply
      0
      • L Lost User

        Check the link http://www.rgagnon.com/javadetails/java-0363.html[^] This may help you

        Regards Aman Bhullar www.arlivesupport.com[^]

        A Offline
        A Offline
        April Fans
        wrote on last edited by
        #3

        public static string getIP(HttpContext rq) { string userIP; HttpRequest Request = HttpContext.Current.Request; if (rq.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != "") userIP = rq.Request.ServerVariables["REMOTE_ADDR"]; else userIP = rq.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userIP == null || userIP == "") userIP = rq.Request.UserHostAddress; return userIP; }

        April Comm100 - Leading Live Chat Software Provider

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups