Query string vanishes on header("Location: ...") redirect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to redirect my users to a URL which includes a query string:

        $the_url =
$CFG->wwwroot."/DLC/includes/L1_accept_required.php?cid=".$course->id;
        //die ("URL = $the_url");
        header('Location: '. $the_url);

When I uncomment the die() command, the URL shows properly, e.g.:

http://mysite.com/DLC/includes/L1_accept_required.php?cid=152

The script at the URL calls the variable cid with $_GET:

$cid = $_GET['cid'];

When I browse directly to the URL as echoed by the die() command, the
value of cid is available to the script. However, when I do the
redirect, the URL that shows up in the browser's location bar does not
contain the query string. Thus, the script at L1_accept_required does
not function properly.

The annoying thing is that the redirect works properly everywhere else
in the site.

Can anyone give me insight into what might be going on? I've checked
for rogue .htaccess files which might be doing some fancy URL
rewriting, but found nothing.

-- 
Richard S. Crawford (rscrawford@xxxxxxxxxxxx)
http://www.mossroot.com
Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux