0

I am using CodeIgniter. In my script, I am changing $config['index_page'] in config.php file as per the user's reponse, i.e, dynamic index_page is used. In order to get it work, I have changed the $config['uri_protocol'] value to "AUTO". Everything is working fine except when the case comes like : domain.com/index_page/auth/register?testvar=1 It's not accepting the get variables and "PAGE NOT FOUND" error is there. I have tried several things already discussed here, but they involve changing the uri_protocol to "PATH_INFO" that I can't change as the site stops working. It requires "REQUEST_URI" to work properly which is exactly the case with "AUTO" setting.

So is there, any way to get it working??? Any help would be appreciated.

3 Answers 3

1

Have a look at this answer: Handling question mark in url in codeigniter it will require you to override the core URI class whenever you are accepting QUERY_STRING and inject your logic there.

Sign up to request clarification or add additional context in comments.

Comments

0

Have you read this: http://codeigniter.com/user_guide/general/urls.html ? You pass vars like this: domain.com/index_page/auth/register/1

The first segment represents the controller class that should be invoked. The second segment represents the class function, or method, that should be called. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.

Also you can do it your way, read the reference. But than why to use a framework at all?

1 Comment

Well actually it is a ready-made script bought by a client of mine. It is using codeigniter framework. Most of the site is working absolutely fine but when it comes to facebook connect then the return url has session data "GET APPENDED" to it... so i can't do anything in it...
0

I've done the same thing in my project and I got the url like

mydomain.com/search/?name=Arun+David&age=23

To achieve this,

In config file set

$config['uri_protocol']='PATH_INFO'; or $config['uri_protocol']='ORIG_PATH_INFO';

if PATH_INFO is not working try using ORIG_PATH_INFO. For me in localhost PATH_INFO is woking but not ORIG_PATH_INFO but while uploading it in server ORIG_PATH_INFO in working but not PATH_INFO.

and in your search controller's constructer add

parse_str($_SERVER['QUERY_STRING'],$_GET);

then you can use $_GET['name'] and $_GET['age'] in your code!.!. :-)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.