headers already sent
| From: | Andrea Bakker | Date: | Fri, 12 Mar 2010 08:56:51 +0000 |
| Subject: | headers already sent | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-30400@lists.php.net to get a copy of this message | ||
I've googled this topic quite a bit and I don't think I understand the way quickform
works. The following code gives the headers already sent error. My login_test_form is just a
simple quickform with 2 username & Password. Does the $loginform->validate() send header
info ? If so how can I ever redirect without getting the "headers already sent" error ?
<?php
$pagename = 'login';
include('config.php');
include(DIR_APPLICATION . '/lib/user.lib.php');
include(DIR_APPLICATION . '/lib/advert.lib.php');
include(DIR_APPLICATION . '/lib/defaultformrenderer.lib.php');
include('functions.php');
include(DIR_APPLICATION . '/lib/login_form_test.php');
if(isset($_POST['Login']))
{if ($loginform->validate()) {
// Form is validated, then processes the data
$url = HTTP_SERVER . "listing.php";
header("Location: $url");
exit;
}
}
?>
<body>
<div id="maincontainer">
<?php include('inc/header.php');
include('inc/topmenu.php');
include('inc/logmenu.php');
?>
<div id="wrapper" class="clearfix">
<div id="maincontentuser">
<?php
$renderer = new DefaultFormRenderer($loginform);
include('inc/head.php');
$renderer->display();
?>
</div>
</div> <!-- end wrapper div -->
<?php include('inc/footer.php'); ?>
</div> <!-- end maincontainer div -->
</body>
</html>