I have 'upgraded' my server and the following doesn't work anymore.
It sits at the top of a page, and is supposed to set some cookies and reload the page with empty query string (and cookies set) if the original URL has the correct query string.
What happens now is that the desired page loads and is then immediately replaced by an attempt to load a non-existent page.
As I said, I reinstalled my server and now the same code works correctly on my production server but not on the reinstalled server. I'm running on Ubuntu 15.04 now. My guess is that I neglected some aspect of php/apache installation, but I really haven't a clue.
Thanks for any help you can give. -- Len
<?php
if ( array_key_exists('rId',$_GET) && $_GET['rId'] == 'auth' ){
setcookie('authCode',$_GET['authCode']);
setcookie('rId',$_GET['rId']);
setcookie('GP_UID',$_GET['GP_UID']);
if ( array_key_exists('license',$_GET) )
setcookie('license',$_GET['license']);
else
setcookie('license',0);
$pth = $_SERVER['REQUEST_URI'];
$pth = substr($pth, 0, strrpos($pth,'/')+1)."index.html";
$url = $_SERVER['SERVER_NAME'].$pth;
echo "<!DOCTYPE HTML><html><head><META http-equiv='refresh' content='0;URL=http://" .$url. "'></head></html>";
return;
exit;
}
?>
<html>
<body id="view2">
<h1> Loaded </h1>
</body>
</html>
exitis never reached. If the application is exactly the same in both servers, it shouldn't make any difference since the other is working. But you can give a try to remove thatreturnand see what happens.