IP addresses in PHP

IP addresses HTTP headers can easily be spoofed and a lot of users (mainly mobile users on for example a wifi connection) have lease times on IP addresses that are very short, thus enabling them to vote again.

That said you can combine options, for example check IP address and set a cookie to make it harder to get around.

If you set a port with the ip address then it will not match your database records/list of IP addresses. Should you ban them for that? I can’t answer that.

Most of your checking method is based on what the request says is the IP address, like the HTTP headers, which are easily spoofed. Don’t trust them or accept that your poll is not going to get accurate results.

If you really want a fair voting system that allows one vote per person you will need to use something else then IP address to identify the user.

Leave a Comment