![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Apr 2008
Posts: 47
Rep Power: 0
![]() |
I am sure everybody had this problem at one point or another and I have done A LOT OF reading about it but still problem presists.
I keep on getting Error message saying header is already sent! The coockie thing is the very first line. I have removed all the spaces, even tried sticking it to the end of <?php still not working! Any ideas as why? My code is: <?php setcookie($A,10); print "<head>\ <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><style type=\"text/css\"> <!-- A{text-decoration:none} --> </style>.................................CONTINUES HERE ";
__________________
^c^ |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
Re: Header is ...
Have you defined $A to be something? And if so, where? Is something being printed there? And if not, then there's your problem.
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Apr 2008
Posts: 47
Rep Power: 0
![]() |
????
setcookie(A,'10');
what do you mean "define". This is where I set the value 10 to A and that's that. It does not get printed anywhere in the same page or any page after because I am getting the error message which means the cookie is not set. I have tried this with session_start() also. Get the exact same problem. Include your code if you have a suggestion and I try it becasue really it is making no sense to me.
__________________
^c^ |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Apr 2008
Posts: 16
Rep Power: 0
![]() |
Re: ????
I beleve the problem is to do with you making a cookie then setting meta infomation.
try using ob_start() and ob_end_flush(); |
|
|
|
|
|
#5 | |
|
Programming Guru
![]() |
Re: Header is ...
Quote:
Read the manual. PHP: setcookie $A = "TestCookie"; $value = 'something from somewhere'; setcookie($A,$value); If what you posted isn't the full code, and you have in fact defined $A, then you should use ob_start() and ob_end_flush() as Apophis suggested. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I silence header? | stu7398 | PHP | 4 | Jan 13th, 2008 6:15 PM |
| making a header file | alphonso | C++ | 14 | Apr 5th, 2006 6:32 AM |
| question about header files and prototyping functions | linuxpimp20 | C | 13 | Sep 7th, 2005 8:28 AM |
| Header files | Klarre | C++ | 13 | Jun 15th, 2005 11:25 AM |
| TCP Header for Echo Communication | AusTex | C++ | 0 | Feb 27th, 2005 3:57 PM |