Welcome Guest, Not a member yet? Register   Sign In
Trouble with The Auth Library 1.02
#1

[eluser]heavener[/eluser]
Hi all, I hope anyone can help with this...

Here's the deal: I installed The Auth Library 1.01 and now I am trying to include the Login View files in to my Home page View.

It (home_main) simply looks like this:
Code:
<div class="sidebar">
    <h3>Log In</h3>
    &lt;?php $this->load->view('auth/login-home'); ?&gt;
</div>

You'll notice that I'm using login-home, because its the login form altered for my home page.

And here is what what my login-home looks like:
Code:
&lt;form method="POST"&gt;
    Username/Email:<br />
        &lt;input type="text" name="username" value="&lt;?php echo set_value('username'); ?&gt;" size="50" class="form" /&gt;&lt;?php echo form_error('username'); ?&gt;<br /><br />
    Password:<br />
        &lt;input type="password" name="password" value="&lt;?php echo set_value('password'); ?&gt;" size="50" class="form" /&gt;&lt;?php echo form_error('password'); ?&gt;<br /><br />
    &lt;input type="submit" value="Login" name="login" /&gt;
&lt;/form&gt;

So, I constructed my Controller loads like this:
Code:
function index()
    {
        $this->load->view('site/header');
        $this->load->view('pages/home_main');
        $this->load->view('site/footer');
    }

But... when I load login-home inside of home_main, the markup only outputs the home_main markup, and without the login-home code!

Here's what it outputs:
Code:
<div class="sidebar">
    <h3>Log In</h3>
    &lt;form method="POST"&gt;
    Username/Email:<br />

This sounds pretty confusing, but I rreeealllly hope someone can help!

Thanks! :lol:
#2

[eluser]TheFuzzy0ne[/eluser]
Hmmm... You might want to try echoing the view:
Code:
&lt;?php echo $this->load->view('auth/login-home', '', TRUE); ?&gt;
I doubt it will do anything, but it's worth a try.

EDIT: Also, check the permissions on your newly uploaded files, and try setting error reporting to E_ALL.
#3

[eluser]heavener[/eluser]
Sorry, didn't change a thing..
#4

[eluser]TheFuzzy0ne[/eluser]
Can you load the login-home view in the controller?
#5

[eluser]heavener[/eluser]
Well, I could, but that would mess up my site structure...

Code:
function index()
    {
        $this->load->view('site/header');
        $this->load->view('pages/home_main');
        $this->load->view('site/footer');
    }

Even if I loaded it after home_main, it would appear after home_main's content, but I want it within that view.

And because I am able to load views within in a view, it shouldn't make a difference which way it's loaded in to a page.

Smile
#6

[eluser]TheFuzzy0ne[/eluser]
I didn't mean as an alternative, I meant purely for debugging. Smile
#7

[eluser]heavener[/eluser]
Okay, I tried it...

Code:
function index()
    {
        $this->load->view('site/header');
        $this->load->view('pages/home_main');
        $this->load->view('auth/login-home');
        $this->load->view('site/footer');
    }

And all I got for an output was just login-home, and nothing else loaded...

And login-home didn't even output properly:
Code:
&lt;form method="POST"&gt;
    Username/Email:<br />
#8

[eluser]TheFuzzy0ne[/eluser]
Have you actually loaded the form validation library? Also, does it make any difference when you include the files manually, or is it still the same result?
#9

[eluser]heavener[/eluser]
Yeah, so I pretty much feel like the biggest idiot.
It works now. I didn't load the library.

Thanks TheFuzzy0ne and all who attempted to help in my idiotic struggle!
#10

[eluser]TheFuzzy0ne[/eluser]
I find that's it's usually wise to check the output HTML source code. Often I've see errors in the that for some reason or another haven't actually rendered on the page. I would have thought you'd have got an error too, for calling on a function that doesn't exist.

Glad you got it sorted. We call have bad days - some more than others... Smile




Theme © iAndrew 2016 - Forum software by © MyBB