Welcome Guest, Not a member yet? Register   Sign In
_GET to array.
#1

[eluser]hugle[/eluser]
Hello everyone.
I'm currently playing with DaoPay call payment procesor.

The problem I met, they give me results via $_GET.

I know $_GET is disabled in CI, but I thought maybe there is a helper or smth like that which would make and array of values from this url tring?

/daopay/results/

daopay - is a controller
results - is a function

so I need the array of these values= '?orderno=706572&price=4.0&prodcurrency=EUR&appcode=50067'



Thanks you, CI community!
#2

[eluser]xwero[/eluser]
set the uri protocol to path_info and in the results method you can do
Code:
parse_str($_SERVER['QUERY_STRING'],$_GET);
You don't have to use the get global you can assign it to a local variable too.
#3

[eluser]hugle[/eluser]
[quote author="xwero" date="1236865813"]set the uri protocol to path_info and in the results method you can do
Code:
parse_str($_SERVER['QUERY_STRING'],$_GET);
You don't have to use the get global you can assign it to a local variable too.[/quote]

thanks it works fine !

just one more question:

if I pass only 1 parameter for example:

/controller/function/?name=MYNAME

I get the error:
Code:
404 Page Not Found

The page you requested was not found.

but if I pass 2 parameters:
/controller/function/?name=MYNAME&last=lastname

Everything just works fine!

thank you in advance
#4

[eluser]xwero[/eluser]
that is the behavior of the uri_protocol auto setting.
#5

[eluser]hugle[/eluser]
[quote author="xwero" date="1237036802"]that is the behavior of the uri_protocol auto setting.[/quote]

thank you for quick explanation.

cheers




Theme © iAndrew 2016 - Forum software by © MyBB