CodeIgniter Forums
Not showing correct output - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Not showing correct output (/thread-7210.html)



Not showing correct output - El Forum - 03-29-2008

[eluser]umicom[/eluser]
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?


Not showing correct output - El Forum - 03-29-2008

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


Not showing correct output - El Forum - 03-29-2008

[eluser]umicom[/eluser]
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

<?php
class Blog extends Controller {

function blog()
{
parent::Controller();
}

function index()
{
$this->load->view('welcome_message');
}
}
?>


Not showing correct output - El Forum - 03-29-2008

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


Not showing correct output - El Forum - 03-29-2008

[eluser]wiredesignz[/eluser]
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


Not showing correct output - El Forum - 03-29-2008

[eluser]umicom[/eluser]
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