Jump to content

Archived

This topic is now archived and is closed to further replies.

atitthaker

headers_list() function problem

Recommended Posts

I am having problem regarding headers_list in HTTP functions...
This is my code below:

<?php
ob_start();
setcookie("test1","cookie value");
header("x_sample_test:foo");
header("content-type:text/plain");
print(var_dump(headers_list()));
print(var_dump(headers_sent()));
?>


So as I am sending three header items(rwo cookies & one header) I am getting a blank array when asking for the headers_list().
My function headers_sent() function is returning true.

So that "true" is bcoz of headers I sent or the headers sent by default?

Plz Help.

Share this post


Link to post
Share on other sites
In order to really help you should post the code for your headers_list function and your headers_sent function...  Give a little insight into what it is the code is doing and what it is not doing...

Share this post


Link to post
Share on other sites
They are built in functions, not created by me. You can find them in PHP manual under HTTP function.

Share this post


Link to post
Share on other sites
ahh see ive never used those -- thought you had written them..  on this one i'll have to step aside and let someone else who's used the functions step in and help.. sorry i was of no use to you..

Share this post


Link to post
Share on other sites
var_dump is a print statement in itself...you can't print a print object if that makes sense
I'm surprised you haven't mentioned an error or something

but anyway...
var_dump(headers_list()); should be sufficient
as well as
var_dump(headers_sent());

Share this post


Link to post
Share on other sites
I did not give any error message bcoz It was not giving me any. One more thing I wanna say is that it is not giving output with or without print statement. I dont understand what's going on there with the script.

Share this post


Link to post
Share on other sites
Try using a newer version.
http://bugs.php.net/bug.php?id=29683

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.