-
- $conn = @ mysql_connect("localhost", "root", "123456") or die("Database link error");
- mysql_select_db("bbs", $conn);
- mysql_query("set names 'gbk'"); //Use gbk Chinese encoding;
- //Convert spaces and newlines into html parsable
- function htmtocode($content) {
- $content = str_replace("n", "< ;br>", str_replace(" ", " ", $content)); //Two str_replaces nested
- return $content;
- }
- //$content=str_replace("'","'", $content);
- //htmlspecialchars();
-
- ?>
Copy code
3) Display page
[code]
$numq=mysql_query("select * from `message`");
$num = mysql_num_rows($numq); //Total number
if($_get
|