If I enter backslashes in the html form, each backslash is escaped with a another backslash. So H\E\L\L\O becomes H\\E\\L\\L\\O. The html form statement calls a PHP script that applies stipslashes. No backslashes are removed though. why? Important code is bolded.
HTML FILE
PHP FILE
still has double backslashes?!
HTML FILE
Code:
<html>
<body>
<style type="text/css">
h1 {font-size: 800%}
h2 {text-align: center; color: red; font-size: 300%}
h3 {font-size: 200%}
h4 {text-align: center; font-size: 120%}
h5 {text-align: center; font-size: 120%}
p {font-size: 100%}
h3 {font-family: times}
h2.pos_left
{
}
h2.pos_right
{
position:relative;
left:20px
}
div.figureleft {
float: left;
width: 25%;
border: thin red solid;
padding: 0.5em; }
IMG.displayed {
display: block;
margin-left: auto;
margin-right: auto }
#clearbreak {
clear: both; }
</style>
<title>Enter Test String</title>
<body bgcolor="#33CCCC" lang=EN-US link=red vlink=purple style='tab-interval:
.5in'>
<H2> The website </H2>
<H4> Enter text </H4>
<H4>
[b]<form action="slashthing.php" method="post">[/b]
<span style="position: relative; LEFT: -20.5px"> Comment:
[b] <input type="text" name="checkstr" [/b]
id="checkstr" value="" size="120" tabindex="1" >
<BR><BR>
<input type="hidden" name="lowestsev" id="lowestsev" value="1" tabindex="2" >
<input type="hidden" name="quickcheck" id="quickcheck" value="0" tabindex="3" >
<input type="submit" VALUE="Test" />
</span>
</form>
</H4>
</body>
</html>
PHP FILE
Code:
<?PHP
echo ' begin ';
echo 'before stripslashes checkstr=';
var_dump($_POST["checkstr"]);
[b]$checkstr = stripslashes($checkstr); [/b]
echo 'after stripslashes checkstr=';
var_dump($_POST["checkstr"]);
?>
still has double backslashes?!