Not showing correct output

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

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

#3
[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');
}
}
?>

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

#5
[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

#6
[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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.