Jump to content

Authenticate contact form submissions


Omzy

Recommended Posts

I use $_SERVER['REMOTE_ADDR'] to get the IP address of the person who fills out my contact form, what other information can I obtain from this IP address and how? For example, country, ISP...

 

Also what other things can I do to improve my contact forms so that I can authenticate form submissions?

Link to comment
Share on other sites

I built a control panel for an online radio station and we wanted to track the locations of visitors and also people who used the online form to send in requests. What you could do is log the IP to a database and then build a simple password protected page, grab the IP addresses and use the MaxMind API to view the information you are wanting.

 

The other thing you could do to make them more secure is have a randomly generated code to enter (not a graphic, they suck) like

$verify=rand(111111,999999);

Send that variable in the from to the next page in a hidden field, and also have a text input asking them to insert that code (which you would echo next to teh nput box) and then compare them on the next page. Makes it less likely that spammers will use the form. Then on the next page, compare the 2 variables to see if the user has inputted the correct code and if so, send the message, if not, error.

 

Hope this helps you.

 

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.