Welcome Guest, Not a member yet? Register   Sign In
$this->load->view('ad.html') does not work?
#1

[eluser]sexy22[/eluser]
hello,everyone!

I have a problem. I am using CI 1.7.0 now.

In my Controller,have below

Code:
function userLogin()
    {
        $name=$this->input->post('username');
        $pwd=$this->input->post('passwd');
        if (!$this->userCl->checkUser($name,$pwd)) {
            $this->load->view('ad_sign.html');
        }else {
            $this->load->view('ad_index.html');  
        }
    }

but $this->load->view('ad_index.html'); and $this->load->view('ad_sign.html') does not work,each here, it shows a blank page

i do not know what i am wrong?
#2

[eluser]bitist[/eluser]
Instead of $this->load->view('ad_sign.html')
you should use
$this->load->view('ad_sign')

Check this page
#3

[eluser]sexy22[/eluser]
[quote author="devpedia" date="1230223521"]Instead of $this->load->view('ad_sign.html')
you should use
$this->load->view('ad_sign')

Check this page[/quote]

because my files is .html,so that i must use ad_sign.html

if you are using ad_sign.php , $this->load->view('ad_sign') is ok

thanks!
#4

[eluser]bitist[/eluser]
You're right, you have to use $this->load->view(‘ad_sign.html’) in case of .html extension.
What happen if you change the view file name to $this->load->view(‘ad_sign_test.html’) ?
Do you get any error?
#5

[eluser]sexy22[/eluser]
[quote author="devpedia" date="1230229502"]You're right, you have to use $this->load->view(‘ad_sign.html’) in case of .html extension.
What happen if you change the view file name to $this->load->view(‘ad_sign_test.html’) ?
Do you get any error?[/quote]

Thank you!

i tried it just now,but does not work,only a blank page,none of any error!
#6

[eluser]bitist[/eluser]
For some reason the error reporting is not working on your script.

You have one point to follow, check the log file which is located under system/logs directory.
#7

[eluser]mamen[/eluser]
why you don't change to .php ??

that's simple right Big Grin
#8

[eluser]Thorpe Obazee[/eluser]
I thought I was dreaming but I thought I saw this post and answered it before I slept last night. turned out I wasn't
http://ellislab.com/forums/viewthread/100660/
#9

[eluser]sexy22[/eluser]
[quote author="mamen" date="1230250233"]why you don't change to .php ??

that's simple right Big Grin[/quote]

asa

The .php is working in server,as to view files,i prefer to use .html
#10

[eluser]sexy22[/eluser]
[quote author="Chamyto" date="1230272434"]I thought I was dreaming but I thought I saw this post and answered it before I slept last night. turned out I wasn't
http://ellislab.com/forums/viewthread/100660/[/quote]


thanks!

.html is ok,i am always using it now!




Theme © iAndrew 2016 - Forum software by © MyBB