CodeIgniter Forums
Little problem - 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: Little problem (/thread-24130.html)



Little problem - El Forum - 11-01-2009

[eluser]jabga[/eluser]
Hi all, I am start using CI and I am also a PHP beginner.

I am trying to create a simple database driven brochure web page.

Please tell me.
I would like to get number of displaying news from GET or POST varuables. How can I do this?

This is controller
Code:
function index()
    {
        $data['limit'] = 10;
        $this->load->view('header', $data);
        $this->load->view('menu', $data);
        $this->load->view('left', $data);
        $this->load->view('frontpage', $data);
        $this->load->view('footer', $data);
}

I would like to change 1 number to $_GET['id'].
This is my view page code

Code:
$query = $this->db->get('news', $limit);
foreach ($query->result_array() as $row)
And I am trying to write my url like this
Code:
http://localhost/CodeIgniter/index.php/welcome/blog?id=1
this shows me an error 404 page
Please correct me how can I mix get or post var and url and database code?

This url is working ok
Code:
http://localhost/CodeIgniter/index.php/welcome/blog



Little problem - El Forum - 11-01-2009

[eluser]jabga[/eluser]
I just would like to create a web which I can show a front page, and last few news in news page and other things.
I am really trying to study PHP + CI, I am a designer. help me please


Little problem - El Forum - 11-01-2009

[eluser]jabga[/eluser]
I realise i should use uri segment and $this->db->insert function right?


Little problem - El Forum - 11-01-2009

[eluser]pistolPete[/eluser]
You should read the user guide, especially:

- http://ellislab.com/codeigniter/user-guide/general/urls.html
- http://ellislab.com/codeigniter/user-guide/general/controllers.html
etc.

Did you already watch the video tutorials? http://codeigniter.com/tutorials/


Little problem - El Forum - 11-01-2009

[eluser]jabga[/eluser]
Yes I had read and watched.
Now it's going fine, thank you.