CodeIgniter PHP Framework - Need to get query string

前端 未结 12 1509
挽巷
挽巷 2020-11-27 04:07

I\'m creating an e-commerce site using CodeIgniter.

How should I get the query string?

I am using a Saferpay payment gateway. The gateway response will be li

12条回答
  •  悲哀的现实
    2020-11-27 04:54

    Thanks to all other posters. This is what hit the spot for me:

        $qs = $_SERVER['QUERY_STRING'];
        $ru = $_SERVER['REQUEST_URI'];
        $pp = substr($ru, strlen($qs)+1);
        parse_str($pp, $_GET);
    
        echo "
    ";
        print_r($_GET);
        echo "
    ";

    Meaning, I could now do:

    $token = $_GET['token'];
    

    In the .htaccess i had to change:

    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    to:

    RewriteRule ^(.*)$ /index.php?/$1 [L]
    

提交回复
热议问题