Welcome Guest, Not a member yet? Register   Sign In
i am not getting login page in in login controller
#1

[eluser]Yogesh_89[/eluser]
this is my code in home controller:

<?=form_open("home/search");?>
<ul class="social-links">
<li>&lt;?=anchor("home", "ONGBULL")?&gt;</li>
</ul>
<div class="clear padding50"> </div>
<ul class="search">
<li>Location</li>
<li>&lt;input type="text" name="location" placeholder="Enter location" /&gt;&lt;/li>
<li>Search</li>
<li>&lt;input type="text" name="keyword" placeholder="Enter your queries" /&gt;&lt;/li>
<li>&lt;!--&lt;input type="image" src="&lt;?php echo base_url(). 'public/images/blue.png'; ?&gt;" height:40px; border:0px; padding-bottom:40px;"/&gt;--&gt;
&lt;input type="submit" id="search" value="search" /&gt;&lt;/li>
<li>&lt;?=anchor("home/Signin", "Sign in")?&gt;</li>
<li>&lt;?=anchor("home/Signup", "Sign up")?&gt;</li>
<li>&lt;?=anchor("login/admin_login", "Admin Login")?&gt;</li>
</ul>


This is code in my login Controller:

class Login extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function admin_login()
{
$this->load->view('adminLogin');
}
}

but i am not getting my content like log in menu and all other things.
#2

[eluser]solid9[/eluser]
The first codes in your home controller?
Isn't it suppose to be the code for your VIEW?

also in your login controller, have you tried putting this as lower case letter,
Code:
$this->load->view(‘adminlogin’);

Not tested but try.


#3

[eluser]Yogesh_89[/eluser]
first code is in view only but i am loading from home controller. After clicking on Admin Login link i am calling login controller, and view page name is adminLogin. Page adminLogin has loaded i can see the page title in title bar but cant display body content in body area, thats my problem
#4

[eluser]foxybagga[/eluser]
If you are loading a view called "adminlogin" - try keeping the name in lowercase and have a file "adminlogin.php" in the views folder in which put the form HTML.

I hope you are not putting HTML in the Controller.

In-case you need further pointers please post the complete Code with File Names and we are here to help!
#5

[eluser]Yogesh_89[/eluser]
home.php(Home Controller)

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

class Home extends CI_Controller {

public function __construct()
{
parent::__construct();
$this->load->helper('form');
$this->load->helper("url");
$this->load->library("form_validation");
$this->load->model("ongModel");
}
public function index()
{
$data['title'] = "Ongbull Live Search";
$this->load->view('index_view', $data);
}
public function search()
{
$data['Search'] = $this->ongModel->search($this->input->post("keyword"), $this->input->post("location"));
$this->load->view("search_view", $data);
}
public function Construction()
{
$this->load->view("construction_view");
}
public function Food()
{
$this->load->view("food_view");

}
public function school()
{
$this->load->view("school_view");
}
public function Electronic()
{
$this->load->view("electronic_view");
}
public function Furniture()
{
$this->load->view("furniture_view");
}
public function Kitchen()
{
$this->load->view("kitchen_view");
}
public function housingLoans()
{
$this->load->view("housingLoans_view");
}
public function contactUs()
{
$this->load->view("contact_view");
}
public function Clothing()
{
$this->load->view("clothing_view");
}
public function Signup()
{
$this->load->view("signup_view");
}
public function Signin()
{
$this->load->view("signin_view");
}

}

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

#6

[eluser]Yogesh_89[/eluser]

login.php(login controller)




&lt;?php
class Login extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function admin_login()
{
$this->load->view('adminlogin');
}
}
?&gt;




finally adminlogin.php in view folder for login form




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Ongbull Live Search&lt;/title&gt;




&lt;style type="text/css"&gt;
#login_form{
width:300px;
background:#f0f0f0;
border:1px solid white;
margin:150px auto 0 300px;
padding:1em;
-moz-border-radius: 3px;
-webkit-border-radius:3px;
}
h1,h2,h3,h4,h5{
padding-top:0;
text-align: center;
}
input[type=text], input[type=password]{
display:block;
margin:0 0 1em 0;
width:280px;
-moz-border-radius:1px;
-webkit-border-radius:1px;
padding:1em;
}
input[type=submit]{
border:none;
margin-right:1em;
padding:0px;
font-size:18px;
-moz-border-radius:2px;
-webkit-border-radius:2px;
background:#348075;
color: white;
-moz-box-shadow:0 1px 0 white;
-webkit-box-shadow:0 1px 0 white;
width:100px;
height:30px;
}
input[type=submit]:hover{
background: #287368; 
cursor:pointer;
}
a{
text-decoration:none;
font-size:20px;
}
.error{
color:#393939;
font-size:15px;
}
fieldset{
width:300px;
margin:auto;
margin-bottom:2em;
display:block;
}
h1{
text-shadow:0 2px 0 white;
}
&lt;/style&gt;
&lt;/head&gt;




&lt;body&gt;
   
    &lt;?php echo validation_errors();  ?&gt; 
    <div id="login_form">
    <h1>Admin Login!</h1>
    &lt;?php
   
    echo form_open("home/validation_credentials");
echo form_input("username", "Username");
echo form_password("password", "Password");
echo form_submit("submit", "Login");
echo anchor("home/signup", "Create Account");
    ?&gt;
    </div>
 &lt;/body&gt;
 &lt;/html&gt;
#7

[eluser]Yogesh_89[/eluser]
index_view.php

&lt;?php include("public/include/common.php"); ?&gt;
&lt;!--Dynamically creates ads markup--&gt;

&lt;?php include_once("public/include/header.php"); ?&gt;
#8

[eluser]Yogesh_89[/eluser]
&lt;!-- Header --&gt;
&lt;header class="header_bg clearfix"&gt;
<div class="container clearfix">
&lt;!-- Social --&gt;
&lt;?=form_open("home/search");?&gt;
<ul class="social-links">
<li>&lt;?=anchor("home", "ONGBULL")?&gt;</li>
</ul>
<div class="clear padding50"> </div>
<ul class="search">
<li>Location</li>
<li>&lt;input type="text" name="location" placeholder="Enter location" /&gt;&lt;/li>
<li>Search</li>
<li>&lt;input type="text" name="keyword" placeholder="Enter your queries" /&gt;&lt;/li>
<li>&lt;!--&lt;input type="image" src="&lt;?php echo base_url(). 'public/images/blue.png'; ?&gt;" height:40px; border:0px; padding-bottom:40px;"/&gt;--&gt;
&lt;input type="submit" id="search" value="search" /&gt;&lt;/li>
<li>&lt;?=anchor("home/Signin", "Sign in")?&gt;</li>
<li>&lt;?=anchor("home/Signup", "Sign up")?&gt;</li>
<li>&lt;?=anchor("login/admin_login", "Admin Login")?&gt;</li>
</ul>
&lt;/form&gt;
&lt;!-- /Social --&gt;
&lt;!--<div class="logo">
hi
</div>
&lt;!-- Master Nav --&gt;
&lt;?php include_once("public/include/masterNav.php"); ?&gt;
&lt;!-- /Master Nav --&gt;
</div>
&lt;/header&gt;
&lt;!-- /Header --&gt;
#9

[eluser]foxybagga[/eluser]
You are including Nav and Header files from "public/include/" - move the folder public/include to views folder and then do not include these files but call them as load->view('public/include/masternav');

Also rename all functions in the controller to lowercase.

Not sure if I am right but am trying to help.
#10

[eluser]Yogesh_89[/eluser]
thanks for helping me. i will try it.




Theme © iAndrew 2016 - Forum software by © MyBB