Redirect problem

From: Date: Mon, 28 Aug 2000 20:46:37 +0000
Subject: Redirect problem
Groups: php.general 
Request: Send a blank email to php-general+get-14000@lists.php.net to get a copy of this message
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

« previous php.general (#14000) next »