I am getting the mac of the user from the url. What I'm trying to do is match to see if the address is genuine. Cause I'll be running it against a database and I don't want to run it if it's not the right format.
This is what I have so far:
if (isset($_GET['mac'])) {
if (strlen($_GET['mac']) == 18) {
$get_mac_filtered = preg_replace('/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', '',$_GET['mac']);
if (preg_match('/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', $_GET['mac']) == $get_mac_filtered) {
echo 'Got a mac match! '.$get_mac_filtered;
}else {
echo 'Sorry !=';
}
}else {die();} }
I'm guessing the problem is somewhere in here (preg_match('/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', $_GET['mac']) == $get_mac_filtered)
because it returns else