Note that there are some explanatory texts on larger screens.

plurals
  1. POcodeigniter Object not found! 404 error
    primarykey
    data
    text
    <p>hi everyone im new to php frameworks development at all, and i can't make this code run please help me im using xampp</p> <p>my welcome controller</p> <pre><code>&lt;?php class Welcome extends CI_Controller { public function index() { $this-&gt;load-&gt;view('home'); } } </code></pre> <p>home view</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;CTS - home&lt;/title&gt; &lt;style type="text/css"&gt; .auto-style1 { text-align: center; } &lt;/style&gt; &lt;/head&gt; &lt;body bgcolor="#C0C0C0" style="height: 226px"&gt; &lt;div class="auto-style1" style="height: 118px"&gt; &lt;img alt="" height="126" src="&lt;?php echo $this-&gt;config-&gt;item('base_url'); ? &gt;/IMG/YUC.png" style="float: left" width="147"&gt; &lt;center&gt;&lt;h1 style="height: 39px; width: 696px"&gt;Cooperative Training Management System&lt;/h1&gt;&lt;/center&gt; &lt;/div&gt; &lt;br&gt; &lt;hr&gt; &lt;div class="auto-style1"&gt; &lt;a href="&lt;?php echo site_url('') ?&gt;users/login"&gt; &lt;img alt="YUC Employee" height="410" src="&lt;?php echo $this-&gt;config- &gt;item('base_url'); ?&gt;/IMG/employee.png" width="139"&gt; &lt;/a&gt; &lt;img alt="trainer" height="410" src="&lt;?php echo $this-&gt;config-&gt;item('base_url'); ? &gt;/IMG/Trainer.png" width="145"&gt; &lt;a href="&lt;?php echo site_url('') ?&gt;users/login"&gt; &lt;img alt="Student" height="410" src="&lt;?php echo $this-&gt;config-&gt;item('base_url'); ? &gt;/IMG/student.png" width="129"&gt; &lt;/a&gt; &lt;h3&gt;Employee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Trainer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Student&lt;/h3&gt; &lt;/div&gt; &lt;hr&gt; &lt;p align="right"&gt;Page generated in &lt;strong&gt;{elapsed_time}&lt;/strong&gt; seconds&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and this is the second controller users</p> <pre><code>&lt;?php class Users extends CI_Controller { function login() { $data['error']=0; if($_POST){ $this-&gt;load-&gt;model('user'); $username=$this-&gt;input-&gt;post('username',ture); $password=$this-&gt;input-&gt;post('password',true); $user=$this-&gt;user-&gt;login($username,$password); if(!$user){ $data['error']=1; }else{ $this-&gt;session-&gt;set_userdata('userID',$user['userID']); redirect(base_url().'home'); } } $this-&gt;load-&gt;view('login'); } function logout() { $this-&gt;session-&gt;sess_destory(); redirect(base_url().'home'); } } </code></pre> <p>and this is the model user</p> <pre><code>&lt;?php class User extends CI_Model { function __construct() { parent::__construct(); $this-&gt;load-&gt;helper('url'); } function login($username,$password) { $where=array( 'username'=&gt;$username, 'password'=&gt;sha1($password) ); $this-&gt;db-&gt;select()-&gt;from('s_users')-&gt;where($where); $querh=$this-&gt;db-&gt;get(); return $querh-&gt;first_row('array'); } } </code></pre> <p>and this is the login view</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;CTS - Login&lt;/title&gt; &lt;style type="text/css"&gt; .auto-style1 { text-align: center; } &lt;/style&gt; &lt;/head&gt; &lt;body bgcolor="#C0C0C0" style="height: 98px"&gt; &lt;div class="auto-style1" style="height: 118px"&gt; &lt;img alt="" height="126" src="YUC.png" style="float: left" width="147"&gt; &lt;center&gt;&lt;h1 style="height: 113px; width: 696px"&gt;Cooperative Training Management System&lt;/h1&gt;&lt;/center&gt; &lt;/div&gt; &lt;br&gt; &lt;hr&gt; &lt;div class="auto-style1"&gt; &lt;fieldset name="Group1"&gt; &lt;legend align="left"&gt;&lt;h1&gt;Login&lt;/h1&gt;&lt;/legend&gt; &lt;?php if($error==1){ ?&gt; &lt;p&gt;Your Username / Password did not match.&lt;/p&gt; &lt;? } ?&gt; &lt;form action="&lt;?=base_url()?&gt;users/login" method="post" style="height: 96px"&gt; &lt;label&gt;Username &lt;/label&gt;&lt;input name="Text1" type="text"&gt; &lt;br&gt; &lt;label&gt;Password&lt;/label&gt; &lt;input name="Password1" type="password"&gt; &lt;br&gt;&lt;br&gt; &lt;input name="Login" style="width: 96px" type="submit" value="Login"&gt; &lt;/form&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;hr&gt; &lt;p align="right"&gt;Page generated in &lt;strong&gt;{elapsed_time}&lt;/strong&gt; seconds&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>.htaccess</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / #Removes access to the system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #When your application folder isn't in the system folder #This snippet prevents user access to the application folder #Submitted by: Fabdrol #Rename 'application' to your applications folder name. RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] &lt;/IfModule&gt; &lt;IfModule !mod_rewrite.c&gt; # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php &lt;/IfModule&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload