NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Whats this error about

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-07-2003, 03:57 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Jul 2003
Posts: 118
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-08-2003, 12:15 AM   #2 (permalink)
NamePros Regular
Join Date: Jun 2003
Location: California
Posts: 245
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, 02:00 AM   #3 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
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.
????: NamePros.com http://www.namepros.com/programming/15096-whats-this-error-about.html

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, 02:49 AM   #4 (permalink)
NamePros Member
Join Date: Jul 2003
Posts: 68
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, 03:39 AM   #5 (permalink)
NamePros Regular
Join Date: Jun 2003
Location: California
Posts: 245
Alpha is an unknown quantity at this point
 



Quote:
Originally posted by crEA-tEch
????: NamePros.com http://www.namepros.com/showthread.php?t=15096
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, 09:22 AM   #6 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
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, 09:38 AM THREAD STARTER               #7 (permalink)
NamePros Member
Join Date: Jul 2003
Posts: 118
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, 11:21 AM   #8 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Quote:
Originally posted by web guru
????: NamePros.com http://www.namepros.com/showthread.php?t=15096
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, 02:35 PM THREAD STARTER               #9 (permalink)
NamePros Member
Join Date: Jul 2003
Posts: 118
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, 02:56 PM   #10 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
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,
????: NamePros.com http://www.namepros.com/showthread.php?t=15096

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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:26 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger