Forum Moderators: coopster

Message Too Old, No Replies

Escaping a backslash?

         

JAB Creations

7:42 am on Dec 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have seen several attempts at messing with my logs by users putting backslashes at the begining of the UA. I tried the following but I'm not sure how to properly escape in this instance?

elseif ($UA==="\"){header("HTTP/1.0 403");die();}

dreamcatcher

12:35 pm on Dec 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



stripslashes?

[hk2.php.net...]

or substr?

elseif (substr($UA,0,1)==="\"){header("HTTP/1.0 403");die();}

dc

JAB Creations

6:39 pm on Dec 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well it didn't work and then I checked the reference page...

Returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\).

I have it working now! I just added another slash! IoI...