Hi,
i am very new to php/apache, and here is what i try to do : i want to buffer a call to a page, than parse it, than display it.
so a page is called through :
http://www.mysite.com/parse.php?targ...ge.php?param=a
here is part of the the parse.php content :
$file = $_GET['target'];
// the next line seems mandatory if i don't just call an existing file like 'myPage.php', but i have some parameters 'myPage.php?param=a'
$file = "http://www.mysite.com/" . $file;
$html = getHTMLResult($file) ;
echo $html ;
here is the function :
function getHTMLResult($filename) {
ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
so, as far as i am testing, this works fine. But i can already see that there are problems with cookies :
here is myPage.php :
<?php
$param= $_GET['param'];
if ($param == "")
echo "noparam" ;
else
echo $param ;
echo "<br>" ;
print($_COOKIE['UserID']);
?>
the param is correct, but the cookie doesn't show up. It is a cookie set by apache to identify the user, with mod_usertrack
i know that the cookie is there, and if i call directly :
www.mysite.com/myPage.php?param=a
it does work
and, i know the problems comes from that line :
$file = "http://www.mysite.com/" . $file;
cause if i don't add the HTTP, it
works without the '?'.
www.mysite.com/parse.php?target=myPage.php
works fine, but of course if i had a ?param=a, it will fail
i hope it is not too messy..any help available ?
thanks
Fab