problem with header()
am 04.10.2006 09:40:54 von j.kuehne
------_=_NextPart_000_0000604A.452381A6
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7Bit
Hi
I can not submit any header() information in the following context.
What is wrong within the code?
require_once "includes/db.inc";
require_once "HTML/Template/ITX.php";
if (!($connection = @ mysql_connect($hostname, $username, $password)))
die("Could not connect to database");
$status = mysqlclean($_GET, "status", 1, $connection);
$template = new HTML_Template_ITX("./templates");
$template->loadTemplatefile("form2tpl.tpl", true, true);
$template->setCurrentBlock("success");
$template->setVariable("AUTOR", $_REQUEST["autor_eb"]);
$template->setVariable("STICHWORT", $_REQUEST["stichwort_eb"]);
$template->setVariable("DATUM", $_REQUEST["datum_eb"]);
$template->setVariable("ANLAGE", $_REQUEST["anlage_eb"]);
$template->setVariable("PROBLEM", $_REQUEST["problem_eb"]);
$template->parseCurrentBlock();
$template->show();
session_start();
foreach($_POST as $Key => $Value) {
$_SESSION[$Key] = $Value;
}
if ($_POST['submit'] == "Eintrag Bearbeiten"){
header("Location: http://127.0.0.1/www2/knowledge_db/knowbase02.php");
exit;
}
?>
Best regards, Joerg Kuehne
------_=_NextPart_000_0000604A.452381A6--
Re: problem with header()
am 04.10.2006 10:14:15 von Dimiter Ivanov
On 10/4/06, j.kuehne@sign-tronic.ch wrote:
> Hi
>
> I can not submit any header() information in the following context.
> What is wrong within the code?
>
>
>
> require_once "includes/db.inc";
> require_once "HTML/Template/ITX.php";
>
> if (!($connection = @ mysql_connect($hostname, $username, $password)))
> die("Could not connect to database");
>
> $status = mysqlclean($_GET, "status", 1, $connection);
> $template = new HTML_Template_ITX("./templates");
> $template->loadTemplatefile("form2tpl.tpl", true, true);
>
>
> $template->setCurrentBlock("success");
> $template->setVariable("AUTOR", $_REQUEST["autor_eb"]);
> $template->setVariable("STICHWORT", $_REQUEST["stichwort_eb"]);
> $template->setVariable("DATUM", $_REQUEST["datum_eb"]);
> $template->setVariable("ANLAGE", $_REQUEST["anlage_eb"]);
> $template->setVariable("PROBLEM", $_REQUEST["problem_eb"]);
> $template->parseCurrentBlock();
> $template->show();
>
>
> session_start();
>
> foreach($_POST as $Key => $Value) {
> $_SESSION[$Key] = $Value;
> }
>
> if ($_POST['submit'] == "Eintrag Bearbeiten"){
> header("Location: http://127.0.0.1/www2/knowledge_db/knowbase02.php");
> exit;
> }
> ?>
>
> Best regards, Joerg Kuehne
There must be NO output to the user, before any header(); calls.
1) Check the files you require() for any whitespaces before the tag
2) IF $template->show(); does what it says, you must start the session
before that call.
3) Good luck :)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: problem with header()
am 05.10.2006 03:25:27 von Bastien Koert
mosts likely you have html output in the page somewhere, perhaps in the
includes or it could be a blank space in one of the files that is above and
outside the php tags
Bastien
>From: j.kuehne@sign-tronic.ch
>To: php-db@lists.php.net
>Subject: [PHP-DB] problem with header()
>Date: Wed, 4 Oct 2006 07:40:54 +0000
>
>Hi
>
>I can not submit any header() information in the following context.
>What is wrong within the code?
>
>
>
>require_once "includes/db.inc";
>require_once "HTML/Template/ITX.php";
>
>if (!($connection = @ mysql_connect($hostname, $username, $password)))
> die("Could not connect to database");
>
>$status = mysqlclean($_GET, "status", 1, $connection);
>$template = new HTML_Template_ITX("./templates");
>$template->loadTemplatefile("form2tpl.tpl", true, true);
>
>
>$template->setCurrentBlock("success");
>$template->setVariable("AUTOR", $_REQUEST["autor_eb"]);
>$template->setVariable("STICHWORT", $_REQUEST["stichwort_eb"]);
>$template->setVariable("DATUM", $_REQUEST["datum_eb"]);
>$template->setVariable("ANLAGE", $_REQUEST["anlage_eb"]);
>$template->setVariable("PROBLEM", $_REQUEST["problem_eb"]);
>$template->parseCurrentBlock();
>$template->show();
>
>
>session_start();
>
>foreach($_POST as $Key => $Value) {
>$_SESSION[$Key] = $Value;
>}
>
>if ($_POST['submit'] == "Eintrag Bearbeiten"){
> header("Location: http://127.0.0.1/www2/knowledge_db/knowbase02.php");
> exit;
>}
>?>
>
>Best regards, Joerg Kuehne
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php