![]() |
#2
jim92013-12-19 00:32
|

<?php
$str1= @$_POST[str1];
//$str2= @htmlentities($_POST[str2]);
$str2= @$_POST[str2];
?>
<title>$_POST demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<table width="100%" cellpadding="2" cellspacing="2">
<tr>
<td valign="top" align="left">
<form method="post">
<h3>字符串:</h3>
<input type="text" name="str1" value="hello " />
<input type="text" name="str2" value="<a href='http://bbs.bccn.net/'>bccn</a>" />
<input type="submit" value="提交">
</form>
</td>
<td valign="top" align="left">
<h3>结果:</h3>
<textarea name="content" id="Content" rows="20" cols="100"><?php
echo $str2;
echo ("\r");
?></textarea>
</td>
</tr>
</table>
$str1= @$_POST[str1];
//$str2= @htmlentities($_POST[str2]);
$str2= @$_POST[str2];
?>
<title>$_POST demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<table width="100%" cellpadding="2" cellspacing="2">
<tr>
<td valign="top" align="left">
<form method="post">
<h3>字符串:</h3>
<input type="text" name="str1" value="hello " />
<input type="text" name="str2" value="<a href='http://bbs.bccn.net/'>bccn</a>" />
<input type="submit" value="提交">
</form>
</td>
<td valign="top" align="left">
<h3>结果:</h3>
<textarea name="content" id="Content" rows="20" cols="100"><?php
echo $str2;
echo ("\r");
?></textarea>
</td>
</tr>
</table>
就像上面这个demo.php 文档. 我只要一提交. 结果是:
<a href=\'http://bbs.bccn.net/\'>bccn</a>
网址链接 头和尾会多出两个 "\" 请问要如何才能去掉.
网上搜了无果. 请知道的大侠不吝赐教. 先谢谢了!