CodeIgniter Forums
Trouble with The Auth Library 1.02 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Trouble with The Auth Library 1.02 (/showthread.php?tid=16652)

Pages: 1 2


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

[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:


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

[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.


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

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


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

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


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

[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


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

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


Trouble with The Auth Library 1.02 - El Forum - 03-12-2009

[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 />



Trouble with The Auth Library 1.02 - El Forum - 03-13-2009

[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?


Trouble with The Auth Library 1.02 - El Forum - 03-13-2009

[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!


Trouble with The Auth Library 1.02 - El Forum - 03-13-2009

[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