Static php page, obtain page cache and generate HTML page

WBOY
Release: 2016-07-28 08:27:06
Original
1035 people have browsed it

include("../conn.php");
$url=$_GET['url'];//URL address
$uid=$_GET['uid'];//id value
function get_center($url_id,$uid){
// $c//Get the content from the cache
$url=$url_id;
$id=$uid;
$c//Assign the cached content to a variable
ob_end_clean();//Close cache and clear
/***End of caching***/
file_put_contents("../".$id.".html", $content);

}
$sql="select * from article where id=".$uid."";
$query=mysql_query($sql);
$rs=mysql_fetch_array($query);
if($rs["url"]==''){
get_center($url,$uid);
$sql="UPDATE article SET url='localhost/weizhuan/".$uid.".html' WHERE id = ".$uid."";
//$sql= "UPDATE article SET FirstName = 'Fred' WHERE LastName = 'Wilson' ";
@mysql_query($sql) or die("sql have err");
echo "";
}else{
get_center($url,$uid);
$sql="UPDATE article SET url='localhost/weizhuan/". $uid.".html' WHERE id = ".$uid."";
//$sql="UPDATE article SET FirstName = 'Fred' WHERE LastName = 'Wilson' ";
@mysql_query($sql) or die ("sql have err");
echo "";
}
?>

The above has introduced the staticization of PHP pages, obtaining page cache and generating HTML pages, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn