PHP仿博客園個人博客數據庫與界面設計(9)_PHP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:PHP session_start()問題解疑(詳細介紹)本文,將這些問題,做一個簡單的匯總,以便大家查閱。 1. 錯誤提示 Warning: Cannot send session cookie - headers already sent Warning: Cannot send session cache limiter - headers already sent 分析及解決辦法 這 一類問題,的原因是你在程序中使用PHP session
后面的部分大同小異, storePostFormValues( ) , storeDiaryFormValues( ); 然后你調用 post model update***( ) 。
看代碼:
function updatePost( )
{
$results['action'] = "updatePost";
$results['pageTitle'] = "Edit post";
$post = new Post;
$cat = new Category;
$results['categories'] = $cat->getCategoryList("post");
if( isset( $_POST['saveChanged'] ))
{
// do update
$post->storePostFormValues( $_POST );
$post->updatePost( );
header("Location: post.php?action=isPost&status=changesSaved") ;
} else if( isset( $_POST['cancel'] ) )
{
header("Location: post.php?action=isPost&status=Cancel");
}else
{
// get the post
$postID = isset( $_GET['postID'] ) ? $_GET['postID'] : " ";
$results['post'] = $post->getPostByID( $postID );
require_once(TEMPLATE_PATH . "/post/post_edit.php");
}
}
到這里就差不多了,我們實現了幾乎所有的基本操作。
幾點說明,這些action 有的是導航,有的是生成的,大部分是固定的。自己看著用吧。 下篇說說 分類的事!還有就是這篇博客寫完后會放在一個網站上
你如果想要源碼學習的話,我會提供下載。謝謝你花這么長時間聽我嘮叨, 看到這句的人,祝你們 昨天 6,1 快樂,嘿嘿。
分享:淺析PHP的ASCII碼轉換類本篇文章是對PHP的ASCII碼轉換類進行了詳細的分析介紹,需要的朋友參考下 復制代碼 代碼如下: class ascii { function decode($str) { preg_match_all( /(d{2,5})/, $str,$a); $a = $a[0]; foreach ($a as $dec) { if ($dec 128) { $utf .= chr($dec); } else if ($dec
相關PHP教程:
- 相關鏈接:
- 教程說明:
PHP教程-PHP仿博客園個人博客數據庫與界面設計(9)
。