Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Query strings combined with CI urls => stopped working in PHP 5.3
#1

[eluser]Nick De Decker[/eluser]
Hello,

I've been using CI 1.7.0 for development of my application.
I use CI url's everywhere, but for credit card authorization my controller is called like this.

http://<<myhostname>>/mycontroller/pay/ok?orderid=xxx&info=yyy .....

This doesn't work anymore on the customer's PHP 5.3 platform: I always get a 404: the page requested was not found (the CI page).

I upgraded to 1.7.2 but it still won't work.

Configuration is exactly the same, everything works except for this thing.
if I put a print_r($_REQUEST) on top of the index.php it does echo out the orderid and info variables, but it doesn't reach the mycontroller/pay.

I don't know enough of CI's flow to debug this. Any idea how to fix this ?

Whenever I put ?something at the end of the url it stops working.
Changing the config's enable querystring option doesn't help.

Thanks in advance.
Nick
#2

[eluser]JHackamack[/eluser]
Have you tried changing your query string value:

Code:
Enabling Query Strings

In some cases you might prefer to use query strings URLs:

index.php?c=products&m=view&id=345
CodeIgniter optionally supports this capability, which can be enabled in your application/config.php file. If you open your config file you'll see these items:

$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then be accessible using the "trigger" words you've set to invoke your controllers and methods:

index.php?c=controller&m=method
http://ellislab.com/codeigniter/user-gui.../urls.html
#3

[eluser]Nick De Decker[/eluser]
Yes I did. But didn't work.

Calling this URI: /welcome/test/message?par1=test123&par2=test456
Works on CI 1.7.2 on my PHP5.2 installation.
But fails with CI 1.7.2 on PHP5.3.

I'm debugging right now and I'll keep you guys posted...
#4

[eluser]JHackamack[/eluser]
It wouldn't be calling the same url

Have you Try calling after changing your query strings?
index.php?c=welcome&m=test&message&part1;=test123&par2=test456
#5

[eluser]Nick De Decker[/eluser]
Hey,

I just found the problem.
In system/libraries/URI.php you got the _fetch_uri_string() function.
This tries to set the path using $_SERVER['PATH_INFO'];

Apparantly this doesn't exist on the client's server.
It is called $_SERVER['ORIG_PATH_INFO'] there Sad

So I added a quick hack and now everything works again:
Code:
if(isset($_SERVER['ORIG_PATH_INFO'])) {
  $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO');
}

Don't know why that is but it works now.

Kind regards,
Nick




Theme © iAndrew 2016 - Forum software by © MyBB