Welcome Guest, Not a member yet? Register   Sign In
Not showing correct output

I'm still learning about CodeIgniter, i wrote the basic script shown in user guide

but I can't seem to get it to show proper, for example if I go to www.umishare.com it loads the welcome page fine but when I added blog.php and now I call it as www.umishare.com/blog it starts to show chinese charaters

Any idea why it does that?

and how to fix that problem?

[eluser]Pascal Kriete[/eluser]
Try changing the opening tag from <? to <?php . Right now none of your code is getting parsed as php, so it might be that your setup doesn't rewrite short tags.

just tried that and it did not work with or without Sad

I can see the welcome.php works and I even tried by copying the code of welcome.php and placing it into blog.php with changes of the name as below and still did not work

class Blog extends Controller {

function blog()

function index()

[eluser]Pascal Kriete[/eluser]
Yeah, 'show source' shows all that. Are you sure you got everything else?

No whitespace before or after php code.
Controller in the right place and filename starts with a lower case.
While we're at it, your constructor name should match the class (ucfirst)

If nothing helps, try renaming the welcome controller and move the blog stuff in there.

Routes default_controller is welcome.php so it will work as default, and don't use the .php extension.

Make sure you use http://domain.tld/index.php/blog unless you're using .htaccess to remove index.php in which case it's http://domain.tld/blog

yep I realise the problem, some how when I logged in via cpanel the code had some ascii before <? not sure why that happens but it seems that from now on I should not use Wordpad to write php script cos it adds strange invisable charaters

Thank you very much I really really appreciate it Smile

Theme © iAndrew 2016 - Forum software by © MyBB