Re: Redirect problem
| From: | jeremy brand | Date: | Mon, 28 Aug 2000 20:49:17 +0000 |
| Subject: | Re: Redirect problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14001@lists.php.net to get a copy of this message | ||
make sure that you don't have spaces after your closing, or before
your opening PHP tags in your include files.
Any white space at all will cause this error.
-jeremy brand
_______________________________________________________________________
GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9
_ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more __
On Mon, 28 Aug 2000, O.J. Alcaraz wrote:
> Date: Mon, 28 Aug 2000 13:46:37 -0700
> From: O.J. Alcaraz <oj@abaristech.com>
> To: "'php-general@lists.php.net'" <php-general@lists.php.net>
> Subject: [PHP] Redirect problem
>
> I am having trouble with a simple redirect. I am just doing a basic form
> where the user enters data, submits it, and then gets redirected to another
> page. I got this to work but after I implemented using some include files,
> etc. I get the header error. I don't really know why I get the error. The
> beginning of my code looks like this:
>
> <?php
> require "constants.inc.php";
> require "functions.inc.php";
>
> db_connect();
>
> if($submit)
> {
> $sql = "INSERT INTO news (user_id, headline, date, body) VALUES
> ($user_id, '$headline', NOW(), '$body')";
> $result = db_query($sql);
> header("Location: index.php");
> }
> include "header.inc";
> ?>
>
> constants.inc.php is just a simple file that sets some global vars. No html
> in it.
> functions.inc.php for now only has some mysql_query functions. No html in it
> as well.
> db_connect() is a call to a function in functions.inc.php
>
> So with all that I am not so sure what is going on. Here is the error
> message I get:
>
> Warning: Cannot add header information - headers already sent by (output
> started at functions.inc.php:25) in /home/httpd/html/channelvcg/adm_news.php
> on line 11
>
> Any help appreciated. Thanks.
>
> O.J. Alcaraz
> Abaris Technologies
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>