CodeIgniter Forums
[SOLVED] How to use URI Segments and Query Strings in the same project - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [SOLVED] How to use URI Segments and Query Strings in the same project (/showthread.php?tid=13932)

Pages: 1 2


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 12-11-2008

[eluser]fensen[/eluser]
CodeIgniter is SO powerful!

If you want to use URI Segments and Query Strings in the same project, go to
Code:
APP/config/config.php
and change:
Code:
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;

This will allow you to use URI Segments, URI Segments parameters and Query String parameters!
e.g.
Code:
/controller/method/param1/param2/?param3=xxx&param4=yyy

This has just saved my life!!!


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 12-16-2008

[eluser]Phil Sturgeon[/eluser]
Nicely done, had been wondering how to mix them for a while now. This has been tested and works nicely! :-)


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 01-07-2009

[eluser]amrnt[/eluser]
[quote author="fabian_o" date="1229074725"]CodeIgniter is SO powerful!

If you want to use URI Segments and Query Strings in the same project, go to
Code:
APP/config/config.php
and change:
Code:
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;

This will allow you to use URI Segments, URI Segments parameters and Query String parameters!
e.g.
Code:
/controller/method/param1/param2/?param3=xxx&param4=yyy

This has just saved my life!!![/quote]

HOW it saves your life... it doesn't work with me ~~~!!!

when i write
www.xppx.com/controller/function/
it returns me to the root page without changes in the URL
moreover when i supply params to become
www.xppx.com/WHATEVER_TEXT_OR_WITHOUT/?c=controller$m=function it works fine....


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 01-13-2009

[eluser]Bahodir[/eluser]
maybe you should write something like this: www.xppx.com/index.php/controller/function/


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 06-25-2009

[eluser]lifo101[/eluser]
(sorry for waking an old thread)

Does anyone know of any OS specific side effects by using PATH_INFO like this? (eg: IIS on Windows)


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 08-27-2009

[eluser]PHP Creative[/eluser]
Sorry for bumping this thread. Sad

With this setup, I need to use the index.php in the URL. Is there anyway to get around this?

Thanks a million


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 09-22-2009

[eluser]Zorancho[/eluser]
I am using .htaccess to remove the index.php from the url. By using this approach about query strings i am able to do this:
http://www.example.com/products/edit/2?category=32

Then i can get the 2 which is the id of the product like this in my controller:
Code:
function edit($id = 0)
{
    echo $id; //prints 2
    echo $_GET['category']; //32
}

Is there anything wrong with this?


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 11-04-2009

[eluser]rebellion[/eluser]
This doesn't work with me neither.

I'm using an SMS service that sends get variables to an URL, in my case: http://mydomain.com/sms/receive_sms/

But CodeIgniter can't read http://mydomain.com/sms/receive_sms/?msgid=x&number=x etc.

What to do? :/


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 11-04-2009

[eluser]mindprojects[/eluser]
Fully working! Perfect...this morning i was struggling with this as well....
The only problem will be with the pagination.....on how to get the right uri segment.


[SOLVED] How to use URI Segments and Query Strings in the same project - El Forum - 11-04-2009

[eluser]mindprojects[/eluser]
For the pagination we'll need to create a custom pagination to append the query string everytime at the end of the url string
so that the URI SEGMENT will be at the same place everytime.We we'll have to build something like:
eg:
controller/function/offset?QUERY_STRING