Welcome Guest, Not a member yet? Register   Sign In
Getting started - only login page working
#1

[eluser]Unknown[/eluser]
Hello.
I never had used CI before, but I have to work on an existing project, which was created with CI, so now I am trying to understand and learn it.
The first step was to get the project to work.. and I still haven't quite got that yet. I made all (I think) the necessary changes to the config files, with my local paths.
The first page, the login screen, is working fine. The login process is working also, as it redirects me to the home page. But from here, nothing else works. I see the controller name in the URL, but the page is blank. Even if I manually set the action name in the URL, it still shows a blank page.
The console error shows the following:

"The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol."

I'm stuck with this and have no idea what to do, so any help would be really appreciated.

Thanks!
#2

[eluser]Unknown[/eluser]
Ok, I was able to detect the problem a little better.
The problem is with the controller's JS code. The controller php file has a "js()" function, which returns the javascript code to be used with the page.
It is included in the page like this:

<?php if($js) { ?>[removed][removed]<?php }?>

But fore some reason, the JS code is causing an error. If I comment the entire js() function , the view opens... with none of the JS, of course.
If I leave the method, even with no code at all, like this:

function js()
{
header('Content-Type: text/javascript');
?>

<?php
}

I already get the error and the page is blank.

The weirdest thing is that the login page uses the exact same structure: the controller has a js() function that returns the javascript code. But in the login page, it works.

Any ideas???




Theme © iAndrew 2016 - Forum software by © MyBB