[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 08-07-2003, 02:57 PM   #1 (permalink)
NamePros Member
 
Join Date: Jul 2003
Posts: 120
185.00 NP$ (Donate)

web guru is an unknown quantity at this point


Whats this error about

I have got this error and I dont have a glue what its about could any one shade any light on this.

------------
Warning: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/paulicon.co.uk/httpdocs/functions.php:66) in /usr/local/psa/home/vhosts/paulicon.co.uk/httpdocs/delete.php on line 22
-------------

Thanx in advance.
web guru is offline  
Old 08-07-2003, 11:15 PM   #2 (permalink)
NamePros Regular
 
Join Date: Jun 2003
Location: California
Posts: 249
401.00 NP$ (Donate)

Alpha is an unknown quantity at this point


I am not sure but does your page have 2 headers or something?
__________________
--Alpha
Alpha is offline  
Old 08-08-2003, 01:00 AM   #3 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


It basically means that your script has already sent some Headers to the browser meaning something like white space, or html or some other headers, and then attempting to do it again, but it can't because the headers have already been sent or something like that.

Some possible things that could cause it is white space before your opening delimiter and all the possiblilites with what was mentioned above

Example, these wouldn't work:

PHP Code:
<html>
<body>
<?
header
("Location: http://www.webdevtalk.com");
?>

                           <?
header
("Location: http://webdesigntalk.net");
?>
But this would:
PHP Code:
<?
header
("Location: http://www.webdevtalk.com");
?>
deadserious is offline  
Old 08-08-2003, 01:49 AM   #4 (permalink)
NamePros Member
 
Join Date: Jul 2003
Posts: 69
107.00 NP$ (Donate)

crEA-tEch is an unknown quantity at this point


im a n00b to php.. when exactly would you use this header thing?

isnt it the same as include?

nick
__________________
M-Factor
crEA-tEch
crEA-tEch is offline  
Old 08-08-2003, 02:39 AM   #5 (permalink)
NamePros Regular
 
Join Date: Jun 2003
Location: California
Posts: 249
401.00 NP$ (Donate)

Alpha is an unknown quantity at this point


Quote:
Originally posted by crEA-tEch
im a n00b to php.. when exactly would you use this header thing?

isnt it the same as include?

nick
Well, the header thing is for the header lol.... What I would do is open the PHP file with a text editor like notepad and search with your eyes or the notepad for header( and see if it appears twice.
__________________
--Alpha
Alpha is offline  
Old 08-08-2003, 08:22 AM   #6 (permalink)
Senior Member
 
Join Date: May 2003
Posts: 2,211
6,170.25 NP$ (Donate)

adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough

Breast Cancer
Quote:
Originally posted by crEA-tEch
im a n00b to php.. when exactly would you use this header thing?

isnt it the same as include?

nick
quite good if your using a log system it sends them straight to the page then instead of seting up a redirect script
adam_uk is offline  
Old 08-08-2003, 08:38 AM   #7 (permalink)
NamePros Member
 
Join Date: Jul 2003
Posts: 120
185.00 NP$ (Donate)

web guru is an unknown quantity at this point


Thanx i have sloved the problem. It was to do with where I was calling the php file fiunctions.php into the script e.g requre("functions.php"). It dident have anything to do with header being called twice cause it wasent. Strange!!
web guru is offline  
Old 08-08-2003, 10:21 AM   #8 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


Quote:
Originally posted by web guru
Thanx i have sloved the problem. It was to do with where I was calling the php file fiunctions.php into the script e.g requre("functions.php"). It dident have anything to do with header being called twice cause it wasent. Strange!!
It may have been the same problem with a different scenario. The examples above using the header function were only used as examples because it sends a header. You don't have to have the actual header function in your code in order for your script to attempt to send the headers twice. It's most likely the actual problem was exactly what the error said.

What did you do to fix it? Maybe move the require up before any other code or white space or something else?
deadserious is offline  
Old 08-08-2003, 01:35 PM   #9 (permalink)
NamePros Member
 
Join Date: Jul 2003
Posts: 120
185.00 NP$ (Donate)

web guru is an unknown quantity at this point


I moved the required field into an if else statement,

------------
if{
header("Location......
}
else{
required("functions.php");
}
------------

This is a scaled down version of the code. It was strange because I run php4 on my test server and it worked fine, but when I uploaded to my online server which runs php3 it through up the error.

Ah well the joys of programming
web guru is offline  
Old 08-08-2003, 01:56 PM   #10 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


Quote:
Originally posted by web guru
I moved the required field into an if else statement,

------------
if{
header("Location......
}
else{
required("functions.php");
}
------------

This is a scaled down version of the code. It was strange because I run php4 on my test server and it worked fine, but when I uploaded to my online server which runs php3 it through up the error.

Ah well the joys of programming
Yes, see that was exactly your problem. And yea, I have had that same error occur many times with php scripts. :beer: :webdev:
deadserious is offline  
Closed Thread


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

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 07:06 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85