Re: Redirect problem
| From: | Martin A. Marques | Date: | Mon, 28 Aug 2000 21:11:07 +0000 |
| Subject: | Re: Redirect problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14009@lists.php.net to get a copy of this message | ||
On Mon, 28 Aug 2000, O.J. Alcaraz wrote:
> 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";
> ?>
Try putting @ in front of the functions that connect and send the query
to the database. There could be outputs there (in case of errors).
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Martín Marqués email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------