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
https://forums.phpfreaks.com/topic/169481-authenticate-contact-form-submissions/
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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.