阅读背景:

安全地将此脚本公开?新手问题

来源:互联网 
<?php

if (isset($_POST['post'])) {

// sanitize variables
$title = mysql_real_escape_string(trim($_POST['title']));
$text = mysql_real_escape_string(trim($_POST['text']));

if (strlen($title) > 3) {

mysql_query("INSERT INTO msgs (title, text, date)
           VALUES('$title', '$text', '".time()."')");
header('location:  msg.php?id='.mysql_insert_id().'');
exit;

}

else {

echo '<h2>Errors</h2><p style="color: maroon">> Fields title and text must consist more than 3     characters.</span>';

}


}

?>
<?php

if (isset($_POST['post'])) {

// sanitiz



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: