<select name="template" id="template">
<option value="none">Don't use template</option>
<option value="RWT">Report Abuse</option>
<option value="renew">Resend Email Codes</option>
</select><br/>
<textarea name="body" rows="10" id="content" value="<?php echo $body;?>"ondblclick="select_all('content');" cols="40"></textarea><br/>
....PHP負載<option>數據到<textarea>
else if ($template == "renew") {
$body = "Dear $username,<br/></br/>";
$body .= "Here is your requested activation code: $activationID <br/><br/>";
$body .= "Thank you.<br/>";
}
當我選擇選項 「更新」,它不會將數據加載到我的textarea。如何在textarea中加載選項數據?
echo htmlentities($ body)會更好。 – tacone 2011-03-06 13:14:10
@tacone:'htmlspecialchars($ body)'會更好:) – Jon 2011-03-06 13:18:56
或者可能是filter_var()。讓我們讓XSS預防火焰戰爭開始:-) – tacone 2011-03-06 13:26:12