PHP combined with Smarty to generate a static page in PHP article pagination code

Source: Internet
Author: User
Tags smarty template
This article introduces the method of using the Smarty template engine to generate static pages in PHP, as well as the implementation Code of the PHP implementation article pagination, which requires a friend's reference.

example, PHP smarty generate static pages, in-article pagination code. Topic: PHP Pagination Code principle

      ', $content);   $num = 0;    foreach ($temp as $key = + $val) {$num + +;    $pagenav = "; if ($key = = 0) {$file _name = '. /html/'. $article _id.    HTML '; } else {$file _name = '. /html/'. $article _id. ' _'. ($key + 1). '.    HTML '; } for ($i =1; $i <=count ($temp), $i + +) {if (($key + 1) = = $i) {$pagenav. = "{$i}"; } else {if ($i = = 1) {$pagenav = $pagenav. " {$i}      ";      } else {$pagenav. = "{$i}";    }}} $_post[' content ' = $val;    $tpl->assign (' A ', $_post);    $tpl->assign (' Pagenav ', $pagenav);    $html = $tpl->fetch (' show_article.html ');    $FP =fopen ($file _name, ' W ');     if ($fp) {fwrite ($fp, $html);    Fclose ($FP); }} alert ("Generate {$num} Chapter Success", ' add_article.php ');} else {alert (' Increase failed! ');}} else {//$FCK->value= ' Fanglor are a boy! '; $editer = $FCK->createhtml (); $tpl->assign (' Editer ', $editer); $tpl->display (' add_article.html ');}? >

To generate a static page related article:

    • Examples of using Smarty to generate static files in PHP
    • Key code for generating static pages for the Smarty template engine
    • PHP methods for generating static pages (three functions)
    • Two ways to generate static files in PHP
    • Smarty methods for generating static pages

article pagination related articles:

    • PHP long article page code sharing
    • PHP long article pagination implementation code
    • PHP article pagination Implementation code
    • PHP Text article pagination code example
    • PHP implementation of long article page display code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.