PHP仿博客園個(gè)人博客數(shù)據(jù)庫與界面設(shè)計(jì)(6)_PHP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:PHP session_start()問題解疑(詳細(xì)介紹)本文,將這些問題,做一個(gè)簡單的匯總,以便大家查閱。 1. 錯(cuò)誤提示 Warning: Cannot send session cookie - headers already sent Warning: Cannot send session cache limiter - headers already sent 分析及解決辦法 這 一類問題,的原因是你在程序中使用PHP session
CREATE 插入
先看這個(gè)指令 post.php?action=newPost
說實(shí)話,我很久沒有插入了。呵呵! 看控制方法:
function newPost( )
{
$results['action'] = "newPost" ;
$results['pageTitle'] = " Add New post" ;
$results['newPost'] = "true";
$results['path'] = "<a href='?action=isPost' >隨筆</a>» <span>添加隨筆</span>" ;
$post = new Post;
$cat = new Category;
$results['categories'] = $cat->getCategoryList( "post");
// 新建文檔
if( isset( $_POST['saveChanged'] ))
{
$post-> storePostFormValues( $_POST );
$result = $post->insertPost( );
if( $result )
{
$post->addChildNumber( "category", $_POST['category'] );
header("Location: post.php?action=isPost&status=Inserted");
}
else
{
header("Location: post.php?action=isPost&error=InsertedFailed");
}
// 保存到草稿箱
} else if( isset( $_POST['saveDraft']) )
{
$post = new Post;
$post-> storePostFormValues( $_POST );
$post->saveDraft( );
header("Location: post.php?action=isPost&status=postSaveToDraft");
// cancel
} else if( isset( $_POST['cancel'] ))
{
header("Location: post.php?action=isPost");
}
else
{
require_once(TEMPLATE_PATH . "/post/post_edit.php");
}
}
分享:淺析PHP的ASCII碼轉(zhuǎn)換類本篇文章是對PHP的ASCII碼轉(zhuǎn)換類進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下 復(fù)制代碼 代碼如下: 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
相關(guān)PHP教程:
- PHPNOW安裝Memcached擴(kuò)展方法詳解
- php記錄頁面代碼執(zhí)行時(shí)間
- PHP中獎概率的抽獎算法程序代碼
- apache設(shè)置靜態(tài)文件緩存方法介紹
- php對圖像的各種處理函數(shù)代碼小結(jié)
- PHP 關(guān)于訪問控制的和運(yùn)算符優(yōu)先級介紹
- 關(guān)于PHP語言構(gòu)造器介紹
- php/js獲取客戶端mac地址的實(shí)現(xiàn)代碼
- php5.5新數(shù)組函數(shù)array_column使用
- PHP preg_match的匹配多國語言的技巧
- php 中序列化和json使用介紹
- php采集文章中的圖片獲取替換到本地
- 相關(guān)鏈接:
- 教程說明:
PHP教程-PHP仿博客園個(gè)人博客數(shù)據(jù)庫與界面設(shè)計(jì)(6)
。