For the Cd2sc.com website features developed, the code for my original, generation speed generally.
(For well-known reasons, the data field name involved in the database has been changed and the part of the parameter filter has been removed for code clarity)
Description: The original dynamic address is moban.php?id=1, the post-generated address is html/200808/sell_1.html. Page.php is a paging program, published in this blog.
Page usage, save this code as make.php, using the method for the browser to access the number of make.php?t= &pg= page, such as make.php?t=300&pg=2, that is, each time 300 data generated, starting from the 2nd page of the data list, That is, skip the previous 300 bars. If you access make.php directly without any parameters, the default is 200 per build, starting from the first page.
Copy CodeThe code is as follows:
if ($_get[pg]== ') {
$AA = 1;
}else{
$aa =$_GET[PG];
}
Include ("admin/conn.php");
Require_once ("page.php");
$result =mysql_query ("SELECT * from 2carsell");
$totle =mysql_num_rows ($result);
$pagelist = $_get[t];
if ($_get[t]== ') {
$pagelist = ' 200 ';
}else{
$pagelist =$_get[t];
}
$pager = new Pager ($totle, $pagelist);
$datastat = "Total
". $pager->countall."Bar, each time you generate
". $pager->countlist."Bar, total build required
". $pager->page."Times ";//Data statistics
$BB = $pager->page;
$pagenav = $pager->backstr. $pager->thestr. $pager->nextstr;
$limitFrom = $pagelist * ($pager->pg-1);
$result =mysql_query ("SELECT * from 2carsell the ORDER by ID DESC limit $limitFrom, $pagelist");
?>
Page generated in the first time:
Print " "; <br>while ($datauser =mysql_fetch_array ($result)) {<br><br> $iid = $datauser [id]; <BR> $html = File_get_contents ("/moban.php?id=". $iid. "); <BR> $sql = "SELECT * from 2carsell where id= $iid"; <BR> $data =mysql_fetch_array (mysql_query ($sql)); <BR> $path =date ("Ym", $data [putdate]); <BR> $testdir = "html/". $path; <br>if (File_exists ($testdir)): <br>else: <br>mkdir ($testdir, 0777); <br>echo "Directory". $testdir. " Create success! <br> "; <BR>endif; <br><br><BR> $filename = "html/$path/sell_$iid.html"; <br><br>//use write mode to open $filename <br>if (! $handle = fopen ($filename, ' W ')) {<br>print ' cannot open file $ FileName "; <BR>exit; <br>} <br><br>if (Is_writable ($filename)) {<br><br>//writes $html to our open file. <br>if (!fwrite ($handle, $html)) {<br>print "cannot write to file $filename"; <BR>exit; <br>} <br> <br>print "File $filename updated successfully! \n\r "; <br><br>fcloSE ($handle); <br><br>} else {<br>print "file $filename not writable"; <br>} <BR>?> <br><? }?> <BR>
$AA = $aa +1;
if ($aa > $bb) {
Echo ' Congratulations, all pages generated! ';
echo "";
}else{
echo "";
}
?>
http://www.bkjia.com/PHPjc/319435.html www.bkjia.com true http://www.bkjia.com/PHPjc/319435.html techarticle for the Cd2sc.com website features developed, the code for my original, generation speed generally. (For well-known reasons, the data field names involved in the database have been changed and ...