2011-12-14 100 views
0

我敢肯定這是一個愚蠢的問題,但由於某種原因,它沒有顯示錯誤。它只顯示一個白色屏幕。表單驗證空

http://kansasoutlawwrestling.com/kowmanager/

應該是一個空的表單提交這樣做: http://kansasoutlawwrestling.com/peach/Template/login.html

<?php if (! defined('BASEPATH')) exit('No direct script access allowed'); 

class Usermanagement extends CI_Controller { 

public function index() 
{ 
    //Config Defaults Start 
    $msgBoxMsgs = array();//msgType = dl, info, warn, note, msg 
    $cssPageAddons = '';//If you have extra CSS for this view append it here 
    $jsPageAddons = '';//If you have extra JS for this view append it here 
    $metaAddons = '';//Sometimes there is a need for additional Meta Data such in the case of Facebook addon's 
    $siteTitle = '';//alter only if you need something other than the default for this view. 
    //Config Defaults Start 


    //examples of how to use the message box system (css not included). 
    //$msgBoxMsgs[] = array('msgType' => 'dl', 'theMsg' => 'This is a Blank Message Box...'); 

    /**********************************************************Your Coding Logic Here, Start*/ 

    // ensure user is signed in 
    if ($this->session->userdata('is_logged_in') == FALSE) { 
     $bodyContent = "login";//which view file // no session established, kick back to login page 
    } 

    $bodyType = "full";//type of template 

    /***********************************************************Your Coding Logic Here, End*/ 

    //Double checks if any default variables have been changed, Start. 
    //If msgBoxMsgs array has anything in it, if so displays it in view, else does nothing.  
    if(count($msgBoxMsgs) !== 0) 
    { 
     $msgBoxes = $this->msgboxes->buildMsgBoxesOutput(array('display' => 'show', 'msgs' =>$msgBoxMsgs)); 
    } 
    else 
    { 
     $msgBoxes = array('display' => 'none'); 
    } 

    if($siteTitle == '') 
    { 
     $siteTitle = $this->metatags->SiteTitle(); //reads 
    } 

    //Double checks if any default variables have been changed, End. 

    $this->data['msgBoxes'] = $msgBoxes; 
    $this->data['cssPageAddons'] = $cssPageAddons;//if there is any additional CSS to add from above Variable this will send it to the view. 
    $this->data['jsPageAddons'] = $jsPageAddons;//if there is any addictional JS to add from the above variable this will send it to the view. 
    $this->data['metaAddons'] = $metaAddons;//if there is any addictional meta data to add from the above variable this will send it to the view. 
    $this->data['pageMetaTags'] = $this->metatags->MetaTags();//defaults can be changed via models/metatags.php 
    $this->data['siteTitle'] = $siteTitle;//defaults can be changed via models/metatags.php 
    $this->data['bodyType'] = $bodyType; 
    $this->data['bodyContent'] = $bodyContent; 
    $this->load->view('usermanagement/index', $this->data); 
} 

function login() 
{ 
    $this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean'); 
    $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean'); 

    if ($this->form_validation->run()) 
    { 

    } 
} 

function logout() 
{ 
    $this->session->sess_destroy(); 
    $this->index(); 
}  

} 

/* End of file usermanagement.php */ 
/* Location: ./application/controllers/usermanagement.php */ 

隨着我的模板系統,任何人看到我會做糾正自己的問題?

回答

1

我剛纔在AIM上與你談過.. 你在頁面上的錯誤。

「消息:無法修改標題信息 - 頭已經發出(輸出開始/home/xtremer/public_html/kowmanager/application/controllers/usermanagement.php:3)」

節目或者與CI會議AREN目前正在運行。或者在您打電話前向瀏覽器輸出內容。親自了解您的CI安裝。我會說你的問題部分是由於缺少_construct。導致您的CI安裝自動加載會話功能。當你想使用類似這是必需的,

$this->session->userdata('is_logged_in') 

把構造函數早在像您有其他控制器,並再次嘗試加載頁面,看看那不解決它。遇到

1

嘗試打開錯誤報告。在你的腳本的頂部添加此行代碼

<?php error_reporting(E_ALL ^E_NOTICE); ?> 

如果仍然不行嘗試在腳本的不同部分呼應的東西,看看它失敗。您的腳本中某處出現解析錯誤或致命錯誤。

你是否在任何地方使用輸出緩衝?

+0

一個PHP錯誤 嚴重性:警告 消息:無法修改標題信息 - 頭已經發出(輸出開始/home/xtremer/public_html/kowmanager/application/controllers/usermanagement.php:3) 文件名:libraries/Session.php 行號:671 – 2011-12-14 23:56:27

2

你有沒有自動加載會話?它看起來像你的代碼沒有__construct()它看起來像你使用另一個庫或幫手,只是確保你必須加載它們