Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

error while login..redirected to wamp homepage

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

error while login..redirected to wamp homepage

Postby scorpio76 » Tue Jul 30, 2013 6:47 am

when i try to run from localhost, the login page appears..but when i try to login using user number and password...it quits to wamp homepage.....anybody can help i will email the full coding..

thank you...pls help

Code: Select all
route.php
php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');


$route['default_controller'] = 'welcome';
$route['enter'] = 'auth';
$route['logout'] = 'auth/logout';
$route['main'] = 'welcome/main';
$route['information/(:num)'] = 'information/info/$1';

$route['404_override'] = '';

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

class Auth extends MY_Controller {

   public function index()
   {
      
      $this->load->view('view-login');
   }
   
   public function logout()
   {      
      $this->session->set_flashdata('mesej', '<span class="label label-info">you have logged out!</span> ');
   
      redirect('../enter');
   }
   
   public function check()
   {
      $query = $this->modelauth->athentic();
      
      if($query)
      {
         foreach($query as $a) {
            $logindata = array(
                      'nostaf'  => $a->no_staf,
                      'nama'  => $a->nama_staf,
                      'email'     => $a->email,
                      'jawatan'     => $a->jawatan,               
                      'logmasuk' => true
                  );
         }

         $this->session->set_userdata($logindata);
         
         redirect('../main');
         
      } else {
         
         $this->session->set_flashdata('mesej', '<span class="label label-info">wrong username or password!</span> ');
         
         redirect('../enter');
      }
      
   }
}

scorpio76
New php-forum User
New php-forum User
 
Posts: 4
Joined: Tue Jul 30, 2013 6:38 am

Return to PHP coding => General

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.