Welcome Guest, Not a member yet? Register   Sign In
Rewrite help.
#1

[eluser]adrian.web20[/eluser]
I'm really really tired.
I've been working all day on this. First of all, the User Guide helped me a lot but until a point. Right now, my head doesn't help me a lot.
I seriously need somebody to tell me "Dude, it's wrong because: "
Please help me :| I'm kinda desperate.

I want to make a job seeker website. I've made a db with some job domains categories. This is the URL for testing purposes: http://blt.ath.cx/
I've hit a big bad wall here. As you can see on the website. The rewrite works perfectly... a bit messed up but that's not a problem, for now.
I've manage to go so far but... know I realize I can't do nothing because I don't know how to get the ID from the category, which is very important.

Can somebody please, look over my work and give me some suggestions? I can't continue without your help :|

Thank you

acasa.php
Code:
<?php

class Acasa extends Controller{

    function Acasa()
    {
        parent::Controller();
        
        $this->load->scaffolding('domenii');
    }    

    function index()
    {
        $data['title'] = "http://www.AngajariPitesti.ro/";
        $data['heading'] = "Lista cu domenii";
        $data['query'] = $this->db->get('domenii');
        $this->load->helper('url');
        $this->load->view('acasa_view', $data);
    }
}

?>

oferta.php

Code:
<?php

class Oferta extends Controller{

    function Oferta()
    {
        parent::Controller();
        
        $this->load->scaffolding('domenii');
    }    

    function categorii($categorie)
    {
    $data['query'] = $this->db->get('domenii');
    $this->load->view('domeniu_view', $data);
    }
}

?>

2 views

acasa_view.php
Code:
<html>
<head>
<title><?=$title?></title>
</head>
<body>
<h1>&lt;?=$heading?&gt;</h1>



&lt;?php foreach($query->result() as $row): ?&gt;

<a >id_domeniu?&gt;-&lt;?=$row->nume_url?&gt;.html">&lt;?=$row->nume_domeniu?&gt;(&lt;?=$row->numar_inscrieri?&gt;)</a><br>

&lt;?php endforeach; ?&gt;

&lt;body&gt;
&lt;/html&gt;

domeniu_view.php
Code:
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
<a href="">Acasa</a>

&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;
&lt;body&gt;
&lt;/html&gt;

.htaccess
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^categorie/(.*)\.html$ oferta/categorii/$1 [C]
RewriteRule ^(.*)$ index.php/$1 [L]


Messages In This Thread
Rewrite help. - by El Forum - 08-12-2009, 04:53 PM
Rewrite help. - by El Forum - 08-12-2009, 05:35 PM
Rewrite help. - by El Forum - 08-12-2009, 07:05 PM
Rewrite help. - by El Forum - 08-12-2009, 10:26 PM
Rewrite help. - by El Forum - 08-13-2009, 02:45 AM
Rewrite help. - by El Forum - 08-13-2009, 03:02 AM
Rewrite help. - by El Forum - 08-13-2009, 03:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB