Cannot add header information?
HEYJeg har fået lavet et script der fungere ligesom en mailform (kontakt side), hvor den skal redirect en over på en anden side. men den giver en fejl:
Warning: Cannot add header information - headers already sent by (output started at /customers/...../.../httpd.www/catalog/enquiry.php:33) in /customers/......../......./httpd.www/catalog/enquiry.php on line 106
Scriptet ser såen her ud:
<?php
/*
$Id: contact_us.php,v 1.39 2003/02/14 05:51:15 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . 'enquiry.php');
// $error = false;
//if ($HTTP_GET_VARS['action'] == 'send') {
//if (tep_validate_email(trim($HTTP_POST_VARS['email']))) {
//$enquiry_total =
//'Interest: ' . $HTTP_POST_VARS['interest'] . "\n\n" .
//'Comments: ' . "\n" . $HTTP_POST_VARS['enquiry'];
//tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry_total, $HTTP_POST_VARS['name'], $HTTP_POST_VARS['email']);
//tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success', 'NONSSL'));
// } else {
// $error = true;
//}
//}
//$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
<title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td>
</tr>
<tr>
<td align="right"><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
</tr>
</table></td>
</tr>
<?php
} else {
?>
<tr>
<td><?//php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main" align="left" style="font-family:verdana;font-size:12px;">
<?
if (isset($_POST["send"])) {
$navn = $_POST["navn"];
$mail = $_POST["mail"];
$titel = $_POST["titel"];
$format = $_POST["format"];
$besked = "Navn: $navn - Mail: $email - Produkt: $format - $titel";
mail("mail@mail.dk","Forespørgsel","$besked");
}
header("Location:default.php");
?>
TEKST
<CENTER>TEKSTCENTER>
<BR><FORM ACTION="enquiry.php" METHOD="post">
<BR> navn: <TABLE>
<TR>
<TD><INPUT TYPE="text" name="navn" style="border:1 solid #000000;width:150;font-family:verdana;font-size:11px;"></TD>
</TR>
</TABLE><BR>
e-mail: <TABLE>
<TR>
<TD><INPUT TYPE="text" name="email" style="border:1 solid #000000;width:150;font-family:verdana;font-size:11px;"></TD>
</TR>
</TABLE><BR>
Hvilken:<TABLE>
<TR>
<TD><INPUT TYPE="text" name="titel" style="border:1 solid #000000;width:150;font-family:verdana;font-size:11px;"></TD>
</TR>
</TABLE><BR>
Hvilket produkt: <TABLE>
<TR>
<TD><SELECT NAME="format" style="border:1 solid #000000;width:150;font-family:verdana;font-size:11px;">
<OPTION>Vælg produkt...</OPTION>
<OPTION VALUE="produkt">produkt</OPTION>
<OPTION VALUE="produkt">produkt</OPTION>
<OPTION VALUE="produkt">produkt</OPTION>
<OPTION VALUE="produkt">produkt</OPTION>
<OPTION VALUE="produkt">produkt</OPTION>
<OPTION VALUE="produkt">produkt</OPTION>
</SELECT></TD>
</TR>
</TABLE><br><BR>
<INPUT TYPE="hidden" name="send" value="nu">
<INPUT TYPE="submit" VALUE="Send" style="border:1 solid #000000;width:150;font-family:verdana;font-size:11px;">
</FORM>
</td>
</tr>
<tr>
<td class="main"></td>
</tr>
<tr>
<td class="main" align="right"><br><?//php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
</tr>
</table></form></td>
</tr>
<?php
}
?>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
har tjekket for tomme linier, men synes ikke jeg kan finde noget. nogen der har svaret på det lille problem?
hilsen
dALLe