I have the following code i use to roughly identify a machine:
$computerId = "UserAgent:".$_SERVER['HTTP_USER_AGENT']."RemoteAddress:".$_SERVER['REMOTE_ADDR'];
I use the following code to compare an escaped vs an unescaped string:
echo "Unescaped:
".$computerId."
Escaped:
".mysqli_real_escape_string($conn, $computerId);
This is the output I get:
Unescaped: UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36RemoteAddress:::1
Escaped: UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36RemoteAddress:::1
As you can see, they are completely identical, and it does not look like the escape is doing anything, as both strings contain unescaped backward-slashes and semicolons. What might be causing this?