Jump to content


Photo

headers_list() function problem


  • Please log in to reply
7 replies to this topic

#1 atitthaker

atitthaker
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationBanglore, India

Posted 26 August 2006 - 05:15 AM

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.
Beginner with PHP and need help

#2 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 26 August 2006 - 05:29 AM

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...

#3 atitthaker

atitthaker
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationBanglore, India

Posted 26 August 2006 - 07:47 AM

They are built in functions, not created by me. You can find them in PHP manual under HTTP function.
Beginner with PHP and need help

#4 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 26 August 2006 - 07:53 AM

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..

#5 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 26 August 2006 - 08:34 AM

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());

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#6 atitthaker

atitthaker
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationBanglore, India

Posted 28 August 2006 - 04:31 AM

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.
Beginner with PHP and need help

#7 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 28 August 2006 - 04:59 AM

Try using a newer version.
http://bugs.php.net/bug.php?id=29683

#8 atitthaker

atitthaker
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationBanglore, India

Posted 28 August 2006 - 10:22 AM

Thank You
Beginner with PHP and need help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users