Validate $_GET variable to be IPV4 IP Format?
December 04, 2012 05:18AM
Hi there,

Can someone point me to the right direction to validate a $_GET variable and in case is not IPV4 format, to ignore that request?

The proper URL format is: https://domain.com/myWS/reporting.php?key=1234&ip=xxx.xxx.xxx.xxx&other=1234
Sometimes, I get the following URL: https://domain.com/myWS/reporting.php?key=1234&ip=<!DOCTYPE...&other=1234

What I want is that if I have something different from a regexp matching the IP V4 format, I want to ignore/drop that request, not even log it in the log file (this will be an extra).

I want to achieve this in the sites-enabled config for that site, probably in the 'server' or 'location' directive, or wherever, just to get it working.

Thanks a lot in advance!



Edited 1 time(s). Last edit at 12/04/2012 05:19AM by cicovy.
Re: Validate $_GET variable to be IPV4 IP Format?
December 06, 2012 03:29AM
Has this forum died? The only way to get some help is to go for the paid support?

I remember a few months ago, replies even from Igor were common, now nothing...

Can someone help me please?

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready