Jump to content

Storing IP Address


qubix

Recommended Posts

Hi All

 

I really hope that someone will be able to help me with a funny that I'm experiencing.

 

I want to record the IP address of users that register for my website, the registration form's source shows the IP address of the visitor using the echo $_SERVER["REMOTE_ADDR"] in a hidden field called "ip_addr"

 

My form also has a 'datesignup' function - that also shows me the date of the signup.

 

In my table called Members - I obviously have a field called 'IP_ADDR' and its properties are:

 

ip_addr VARCHAR(15) NOT NULL default '',

 

My problem is, the IP address never gets recorded into my members table IP_Addr column, but the datesignup does get stored in the 'datesignup' column - so i know data is recorded.

 

Has anyone ever experienced this before?  I've hunted high and low and cannot find a resolution.

 

Thanks in advance

 

QUbix

 

 

Link to comment
Share on other sites

if your query is working and all other data besides the IP is being added into the database, then mysql doesn't see a problem with your query -- are u sure there's actual data in the $_POST, $_GET or $_SERVER variable you're passing to the section of mysql that is attempting to add the IP to your DB?  echo out your sql statement and see if the var is showing a blank entry.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.