Welcome Guest, Not a member yet? Register   Sign In
Not Found
#1

[eluser]Nuage[/eluser]
hello dear friends,
I am developing a webpage. But when i click on the links it says The requested URL /ci/electric/subcategory/1 was not found on this server.

here is some information of my pages and config files:
$config['index_page'] = "index.php";
$route['default_controller'] = "electric";

The link: http://localhost/ci/electric/subcategory/1

I have the subcategory function too. which loads the view file..
function subcategory()
{
$id = $this->uri->segment(3);
$data['query'] = $this->db->query('SELECT * FROM categories WHERE category_id = '.$id.'');
$this->load->view('subcategory_view', $data);
}

So what is the problem?
Thanks in advance..
#2

[eluser]Symcrapico[/eluser]
try
Code:
http://localhost/ci/index.php/electric/subcategory/1
#3

[eluser]Nuage[/eluser]
When i try http://localhost/ci/index.php/ it does not load the image files of the web site.. Then when i click on the links to have the url: http://localhost/ci/index.php/electric/subcategory/1 it does not load subcategory view file..

Still having a big problem..
#4

[eluser]jedd[/eluser]
I'm assuming you've sprinkled echos liberally through your code - are you seeing it get to anywhere in here?
Code:
function subcategory()
    {
        // Here would be a good spot to put an echo ...
        $id = $this->uri->segment(3);
        // change this to
        $query = $this->db->query('SELECT * FROM categories WHERE category_id = '.$id.'');
        // Here would be a good spot to put some echos of child query calls, eg $query->num_rows() to start with
        $this->load->view('subcategory_view', $data);
    }


Oh, and you might also want to change your code thus:
Code:
function subcategory( $id = NULL)
    {
        if ( ! $id)
             die();  // pick your own bomb out approach
        $data['query'] = $this->db->query('SELECT * FROM categories WHERE category_id = '.$id.'');
#5

[eluser]Nuage[/eluser]
well i did not try this yet. i will.. but the problem is..
when i try to have a link like:

http://localhost/ci/index.php/electric/example

and think that i have a view file example_view with only saying Hello world.. it does not work either..

404 Page Not Found

The page you requested was not found.

The link is without index.php default.. do you know how to change it? i am using CI 1.7.1 in 1.7.0 i never had that problem?
#6

[eluser]jedd[/eluser]
OOC, what is your config/config.php entry around line 15, the one that starts with:

Code:
$config['base_url'] =
#7

[eluser]Nuage[/eluser]
http://127.0.0.1/electric
#8

[eluser]jedd[/eluser]
Okay .. do you see a problem with telling CI that all the URL's will start with this:

Code:
http://127.0.0.1/electric

And you're trying to lookup URL's such as:

Code:
http://localhost/ci/index.php/electric/example
http://localhost/ci/electric/subcategory/1
#9

[eluser]Nuage[/eluser]
Yes..
it says:

Not Found

The requested URL /ci/electric/subcategory/1 was not found on this server.
#10

[eluser]TheFuzzy0ne[/eluser]
lol. I'll leave this one to Jedd as I'm heading out.




Theme © iAndrew 2016 - Forum software by © MyBB