Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2003, 05:18 PM
Authorized User
 
Join Date: Jun 2003
Location: San Jose, CA, USA.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot add header information....

Ok, here's another one to test your noodle. Here's the error.

Warning: Cannot add header information - headers already sent by (output started at /user1/****/www/editor/class/lang.class.php:134) in /user1/****/www/admin/edit_articles.php on line 165


Obviously this means that file1: lang.class.php is sending out header information. I want to simply use this to redirect the browser:

header("Location: edit_articles.php");

So how can I do this without removing file1? Any ideas? I know this is cheezy, but eberything I have read only explains how to start header output, not how to either start new header or append to the existing.

----------
~cmiller
__________________
----------
~cmiller
Reply With Quote
  #2 (permalink)  
Old September 2nd, 2003, 07:02 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If lang.class.php doesn't actually echo anything to the user (and, in my opinion, it shouldn't if it's just a class definition file), then look for whitespace outside of your <?php and ?> tags.

99% of all "Cannot add header info" errors are due to whitespace outside of the PHP delimiter tags. This whitespace is considered HTML by PHP, so if PHP encounters any, it'll send the default HTTP headers and begin the HTML document with that whitespace.


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
add extra header in datagrid p330418 ASP.NET 2.0 Professional 1 April 9th, 2008 10:30 AM
WordML - how to add custom information robbert XML 3 August 23rd, 2006 05:44 AM
HOw can i add Header and footer? NinaWilliam ASP.NET 1.0 and 1.1 Basics 0 April 25th, 2006 04:22 AM
Add Push button or Check Box in outlook add-ins capdevs VS.NET 2002/2003 0 January 7th, 2006 08:51 AM
PHP ( Cannot modify header information) squared_ring Beginning PHP 6 August 14th, 2004 05:29 AM



All times are GMT -4. The time now is 03:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.