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

[eluser]piranha_swe[/eluser]
Hi!

I just started working with my first framework, CI.
I have run in many problems today but solved them so far. But right now I think I could use some help.

First, I wonder about the .htaccess thing to remove index.php. I got this code from the CI guide:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

but if I create a file called .htaccess in the folder where index.php is located I just get errors. What should I do?

My real trouble right now is figuring out how to use URIs right.
I have a page with a list of items from db. The list contains links that in normal PHP would be like example.com/list.php?id=45

Now they are example/list/45.

Problem is that when I click a second item in the list it get example/list/45/94 and then example/list/45/94/24.

The "id" keeps stacking up. I cant think I will have to explode and rebuild the url, there must be a standard way to do this?
#2

[eluser]Pascal Kriete[/eluser]
For the first problem I would encourage you to search through the forum and maybe take a look at apache's htaccess documentation. It's server specific, so there is no one-size-fits-all solution, but it does come up quite frequently.

The second problem is easier. It's caused by how you're constructing your links. Take a look at the anchor() function in the url helper:
Code:
echo anchor('controller/method/'.$id, $item_name);

Hope that helps, welcome to CodeIgniter.




Theme © iAndrew 2016 - Forum software by © MyBB