CodeIgniter Forums
Help with simple code!! :) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Help with simple code!! :) (/showthread.php?tid=25005)



Help with simple code!! :) - El Forum - 11-27-2009

[eluser]ssloxing[/eluser]
Hello I'm new to codeigniter and I have just a simple code here
blog.php:
Code:
<?php
class Blog extends Controller{

    function index()
    {
        echo "Test!";
    }

}
?>

I use xampp as "home server" and I just get a white page when I running this... Please Need help.. I think this is because of the xampp because it's working with wamp server at another place Smile

/ssloxing


Help with simple code!! :) - El Forum - 11-27-2009

[eluser]joeizang[/eluser]
ssloxing,

why don’t you just do the proper thing and use a view instead of echoing?
Code:
class Blog extends Controller
{
   function Blog()
   {
     parent::Controller();
   }
  
   function index()
   {
     $this->load->view('viewfile');
   }
}
and then in your view just put what you want to a regular html file and save as php or an empty file and echo what yo


Help with simple code!! :) - El Forum - 11-27-2009

[eluser]ssloxing[/eluser]
[quote author="joeizang" date="1259335938"]
Code:
class Blog extends Controller
{
   function Blog()
   {
     parent::Controller();
   }
  
   function index()
   {
     $this->load->view('viewfile');
   }
}
[/quote]

I've tryied that to and it doesn't work either :down: ...


Help with simple code!! :) - El Forum - 11-27-2009

[eluser]ssloxing[/eluser]
Code:
<?php
class Blog extends Controller{

    function index()
    {
        echo "Test!";
    }

}
?>
This worked at home anyways where I use wamp server so you know Smile
So I don't need any more help, thnx anyway Smile