Current location: Hot Scripts Forums » Programming Languages » PHP » PHP - page buffering - cookies problem


PHP - page buffering - cookies problem

Reply
  #1 (permalink)  
Old 11-11-05, 03:08 AM
yinyang yinyang is offline
New Member
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question PHP - page buffering - cookies problem

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
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP form problem jonnekke PHP 6 10-21-05 03:51 AM
help with this 150kb php page please?? aemobile PHP 6 01-08-05 04:26 AM
Problem on Page vmgautam PHP 1 09-27-04 10:08 AM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 11:19 AM
dynamic php page. tehnoobe PHP 4 04-02-04 11:49 AM


All times are GMT -5. The time now is 06:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.