Part of the EllisLab Network
   
 
uri problem
Posted: 21 June 2009 09:03 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  32
Joined  05-23-2009

i have problem in uri , i am using this

<a href='projects/index/{id}' rel="lyteframe">{code}</a

first time it goes correctly, and uri becomes

http://localhost/project/index.php/projects/index/5 

when i second time clink on it then uri becomes, then it concatenates with previous one and becomes

http://localhost/project/index.php/projects/index/5/projects/index/6 

can some one tell me how to get rid of this ??

Thanks

Profile
 
 
Posted: 21 June 2009 09:14 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1442
Joined  03-10-2009

Auto load URI helper class and try this:

<a href='<?php echo site_url(); ?>projects/index/{id}' rel="lyteframe">{code}</a
 Signature 

Isset | Isset Public Code Repo | Simple Message Library | Session Profiler for CI2.0 | CI session issues in IE

Profile
 
 
Posted: 21 June 2009 09:15 AM   [ Ignore ]   [ # 2 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  3896
Joined  04-25-2008

You need to prefix you’re URL with a forward slash:

<a href='/projects/index/{id}' rel="lyteframe">{code}</a

EDIT: ...Or do what n0xie suggested :D

 Signature 

Remember the 8 Ps: Perfect Planning and Prior Preparation Prevents Piss-Poor Performance.


Not sure where to start with your project? Need some inspiration? Check out my CodeIgniter Resources thread

Profile
 
 
Posted: 21 June 2009 09:16 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  28
Joined  05-21-2009

Firstly setup project.loc address for developing app:

http://www.elxis.org/guides/developers-guides/local-apache-and-virtual-hosts.html

Then link from root like that:

<a href='/projects/index/{id}' rel="lyteframe">{code}</a

When you upload to your web site, you have not to change anything i will be not use any extra helper.

I think this is best way.

Profile