Jeff Davidson
Jeff Davidson

Reputation: 1929

Form Validation Empty

I'm sure this is a stupid question but for some reason its not showing the errors. Its only displaying a white screen.

http://kansasoutlawwrestling.com/kowmanager/

Should be doing this on an empty form submission: 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 */ 

With my template system anyone see what I would have to do to correct his problem?

Upvotes: 0

Views: 111

Answers (3)

chris
chris

Reputation: 36937

I talked to you on AIM briefly earlier.. The error your getting on the page.

"Message: Cannot modify header information - headers already sent by (output started at /home/xtremer/public_html/kowmanager/application/controllers/usermanagement.php:3)"

Shows either sessions with CI aren't currently running. Or your outputting something to the browser prior to your call for the session.. Knowing your CI install personally. I would say your issue is in part the lack of the missing _construct. Cause your CI install auto loads session capability. Which is required when you want to use something like,

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

Put the construct function back in like with the other controllers you have, and try loading the page again, see if that doesnt fix it.

Upvotes: 1

Khairu Aqsara
Khairu Aqsara

Reputation: 1310

have you call autoload of the session ? it look like your code have no __construct() it is look like to you using another library or helper, just make sure you have to load them

Upvotes: 2

John Webber
John Webber

Reputation: 68

try turning on error reporting. on the top of your script add this line of code

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

if that still doesn't work try echoing something at different parts of the script to see where it fails. You either have a parse error or a fatal error somewhere in your script.

are you using output buffering anywhere?

Upvotes: 1

Related Questions