CodeIgniter Forums
Repetitive URL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Repetitive URL (/thread-23216.html)



Repetitive URL - El Forum - 10-04-2009

[eluser]Unknown[/eluser]
Try going to this link:
http://codeigniter.com/bug_tracker/bug_tracker/bug_tracker
It works, even though it shouldn't, and it happens with my CI site too.

Anyone has a simple solution to this problem?


Repetitive URL - El Forum - 10-04-2009

[eluser]Tom Schlick[/eluser]
do you have a function in your controller named bug_tracker? (the constructor)


Repetitive URL - El Forum - 10-05-2009

[eluser]Unknown[/eluser]
No, that's just a url on this site. For my site I have a controller name "Articles" , and when I type http://mysite.com/articles/articles/articles , it works. I know it's not a serious problem but I need to fix it anyway.


Repetitive URL - El Forum - 10-05-2009

[eluser]Tom Schlick[/eluser]
can you paste the controller code here. and your routes.php file if you have made any customization to it


Repetitive URL - El Forum - 10-14-2009

[eluser]khagendra[/eluser]
This is not so bog problem. The reason may be as follows
1 suppose there is a function with parameter and if we are invoking this function without passing any arguments then the Severity: Warning will occur.

2. suppose there is a function with no parameter and if we are invoking this function passing any arguments then the function will executes ignoring the parameters.
so, http://sitename/controllerName/controllerName/ will executes as the index() function of the controller executes ignoring rest of the uri segment.

you can test this trying the code as i have explained.

Example1:

class Test extends Controller
{
function Test()
{
parent::Controller();
}

function index()
{
echo "hi";
}

function show($s)
{
echo $s;
}
}

Try with http://sitename/test/show, it will generates error.

Example2:

class Test extends Controller
{
function Test()
{
parent::Controller();
}

function index()
{
echo "hi";
}

function show()
{
echo $s;
}
}

Try with http://sitename/test/show/show/show, it will works.
hope this will help to understand.


Repetitive URL - El Forum - 10-14-2009

[eluser]khagendra[/eluser]
[quote author="khagendra" date="1255560732"]This is not so bog problem. The reason may be as follows
1 suppose there is a function with parameter and if we are invoking this function without passing any arguments then the Severity: Warning will occur.

2. suppose there is a function with no parameter and if we are invoking this function passing any arguments then the function will executes ignoring the parameters.
so, http://sitename/controllerName/controllerName/ will executes as the index() function of the controller executes ignoring rest of the uri segment.

you can test this trying the code as i have explained.

Example1:

class Test extends Controller
{
function Test()
{
parent::Controller();
}

function index()
{
echo "ci forum";
}

function show($s)
{
echo $s;
}
}

Try with http://sitename/test/show, it will generates error.

Example2:

class Test extends Controller
{
function Test()
{
parent::Controller();
}

function index()
{
echo "ci forum";
}

function show()
{
echo "it will works";
}
}

Try with http://sitename/test/show/show/show, it will works.
hope this will help to understand.[/quote]