php+ mysql留言板的制作函数
1.php连接mysql数据库的步骤 例:$conn = mysql_connect("localhost","root","123")or die("连接错误"); mysql_select_db("bbs2","$conn"); mysql_query("set names 'GBK'"); 2.str_replace() 替换函数 例:function aa($content){ str_replace("/n","<br>",str_replace(" "," ",$content)); return $content; } 3.htmlspectionchars() 格式化html 4.cookie的使用和登录 4.md5()加密 例:$pw = md5($_POST['password']); |