Calling code
js_bbs.php (placed in the root directory) Content
require ("bbs/config.inc.php");
//Connect, select database
$link = mysql_connect( $dbhost,$dbuser, $dbpw) or die('Could not connect:'.mysql_error());
mysql_select_db($dbname) or die("Could not elect database");
$fid=$_GET[" fid"];
//Intercept character length
$length=36;
//Prevent Chinese garbled characters
mysql_query("set names 'gb2312'");
//Execute SQL query
$query = "SELECT tid,subject FROM cdb_threads where fid='$fid' order by lastpost desc LIMIT 10";
$result = mysql_query($query) or die("Query failed: ".mysql_error( ));
// Display the results in HTML
while ($myrow = mysql_fetch_row($result))
{
printf("document.writeln("