Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/08/2006, 07:51
Avatar de Kalili
Kalili
 
Fecha de Ingreso: enero-2002
Ubicación: Gate 69
Mensajes: 210
Antigüedad: 22 años, 3 meses
Puntos: 0
Problemas con header

no encuentro el fallo. Me da el siguiente error

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/tvm-e-learning.com/httpdocs/linse/registro.php:14) in /home/httpd/vhosts/tvm-e-learning.com/httpdocs/linse/registro.php on line 122

Aunque ya se que los headers dan error si hay un output antes, que me aconsejariais hacer en este script?? Es un script de registro a una base de datos
muchas gracias. Decir que la linea 14 es donde empieza el <style>

Código PHP:
<?php
    
include("cookies.inc");
    include(
"instellingen.inc");
    
session_start();
    
    
database("connect");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Linse B.V. Webshop</title>
<link rel="stylesheet" type="text/css" href="images/linse.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
.style1 {color: #FF0000}
</style>
</head>
<body>
<div align="center">
<table width="800" border="0" cellpadding="10" cellspacing="0"> 
    <tr> 
      <td bgcolor="#FFFFFF"><div id="DivPrincipal" name="DivPrincipal"> 
        <div id="DivCabecera" name="DivCabecera">
          <div align="center"><br />
            <br />
            <img src="images/top.jpg" width="780" height="120" /><br />
          </div>
        </div> 
        <table id="TablaPrincipal" cellspacing="0" cellpadding="0" width="100%" border="0"> 
          <tr> 
            <td class="PaginaActual" width="28%" rowspan="2">&nbsp;</td> 
            <td class="EstadoActual" valign="center" nowrap="nowrap" align="left"><div align="right">Your cart <a href="cart.php?action=showcart&categoriaID=<?=$_GET['categoriaID'];?>"><img src="images/carrito.gif" width="11" height="11" border="0" /></a> </div></td> 
          </tr> 
          <tr> 
            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0"> 
                <tr> 
                  <td width="7"><img src="images/barra_izq.gif" width="7" height="6" /></td> 
                  <td><img src="images/barra_pixel.gif" width="100%" height="6" /></td> 
                  <td width="7"><img src="images/barra_der.gif" width="7" height="6" /></td> 
                </tr> 
              </table></td> 
          </tr> 
          <tr> 
            <td class="ContenidoMenu" valign="top" align="left"> <table width="100%"  border="0"> 
                <tr> 
                  <td class=EnlacesMenu bgcolor="#E8E8E8" onmouseover='this.style.background="#BDBCBC"' onmouseout='this.style.background="#E8E8E8"'><strong><a class=EnlacesMenu href="index.php?categoriaID=1">Handlieren</a></strong></td> 
                </tr> 
                <tr> 
                  <td class=EnlacesMenu bgcolor="#E8E8E8" onmouseover='this.style.background="#BDBCBC"' onmouseout='this.style.background="#E8E8E8"'><strong><a class=EnlacesMenu href="index.php?categoriaID=2">Electrische lieren</a></strong></td> 
                </tr> 
                <tr> 
                  <td class=EnlacesMenu bgcolor="#E8E8E8" onmouseover='this.style.background="#BDBCBC"' onmouseout='this.style.background="#E8E8E8"'><strong><a class=EnlacesMenu href="index.php?categoriaID=3">Hydraulische lieren</a></strong></td> 
                </tr> 
              </table></td> 
            <td class="ContenidoPrincipal" valign="top" align="left" rowspan="2"> 
            <br/> 
            <table width="640" border="0" cellspacing="0" cellpadding="10">
              <tr>
                <td>If you are not registered yet, you have to do it before you can go to the checkout. Thank you</td>
              </tr>
            </table>
            <br />
            <table width="640"  border="0" cellspacing="0" cellpadding="10">
              <tr>
              <?php
              
if ($_SERVER['REQUEST_METHOD'] == "POST") {
                  
$company $_POST["txtCompany"];
                
$name $_POST["txtNaam"];
                
$firstname $_POST["txtAchternaam"];
                
$login $_POST["txtLogin"];
                
$password $_POST["txtPassword"];
                
$datum date("F j, Y, g:i a");
                
$email $_POST["txtEmail"];
                
$adres $_POST["txtAdres"];
                
$cp $_POST["txtCp"];
                
$city $_POST["txtLocatie"];
                
$country $_POST["bill_country"];
                
$phone $_POST["txtTelefoon"];
                
$fax $_POST["txtFax"];
                
                if (
$company == ""){
                
$error "Company, ";}
                if (
$name == ""){
                
$error .= "Firstname, ";}
                if (
$firstname == ""){
                
$error .= "Lastname, ";}
                if (
$login == ""){
                
$error .= "Login, ";}
                if (
$password == ""){
                
$error .= "Password, ";}
                if ((!
ereg(".+\@.+\..+"$email)) || (!ereg("^[[email protected]]+$"$email))){
                
$error .= "E-mail, ";}
                if (
$adres == ""){
                
$error .= "Adress, ";}
                if (
$cp == ""){
                
$error .= "Postal code, ";}
                if (
$city == ""){
                
$error .= "City, ";}
                if (
$country == ""){
                
$error .= "Country, ";}
                if (
$phone == ""){
                
$error .= "Phone, ";}
                
                if(
$error){
                 
?>
                <td><font color="#FF0000">Please, fill in correct the following fields: <?php echo $error ?>thank you.</font></td>
                <?php
                
}
                else 
                {
                
$str_sql "INSERT INTO klanten
                                    (KLANT_COMPANY, KLANT_NAME, KLANT_FIRSTNAME, KLANT_LOGIN, KLANT_CONTRASENA, FECHA_KLANT_ALTA, KLANT_EMAIL, KLANT_ADRES, KLANT_LOCATIE, KLANT_CP, KLANT_LAND, KLANT_TELEFOON, KLANT_FAX)
                            VALUES
                                 ('$company', '$name', '$firstname', '$login', '$password', '$datum', '$email', '$adres', '$city', '$cp', '$country', '$phone','$fax')"
;
                
mysql_query($str_sql) or die("Error " mysql_error());
                
$sql "SELECT * FROM klanten WHERE KLANT_LOGIN = '$login' AND KLANT_CONTRASENA = '$password'";
                
$result mysql_query($sql) or die(mysql_error());
                if (@
mysql_num_rows($result) > 0) {
                        
$row mysql_fetch_assoc($result);
                        
$_SESSION['login_session']['idklant'] = $row['IDKLANT'];
                        
$idklant $_SESSION['login_session']['idklant'];
                        
mysql_query ("UPDATE cart SET IDKLANT = $idklant where IDCOOKIE = '" GetCartId() ."'");
                        }
                
mysql_close();
                
header("Location:buckaroo.php");
                }}
                
?>
              </tr>
              <tr>
                <td><form action="" method="post" name="Form" id="Form">
                  <table width="100%" border="0">
                    <tr>
                      <td><strong>Company :</strong></td>
                      <td><input name="txtCompany" type="text" id="txtCompany" size="50" /> 
                        <span class="style1">*</span> </td>
                    </tr>
                    <tr>
                      <td width="19%"><strong>Firstname :</strong></td>
                      <td><input name="txtNaam" type="text" id="txtNaam" size="50" />
                        <span class="style1">*</span></td>
                    </tr>
                        <input type="submit" name="SEND" value="Submit" />
                        <input type="reset" name="Submit2" value="Reset" />
                    </td>
                    </tr>
                  </table>
                </form></td>
              </tr>
            </table>
          </tr> 
          <tr> 
            <td class="ContenidoMenu" valign="top" align="middle">&nbsp;</td> 
          </tr> 
          <tr> 
            <td class="ContenidoMenu" valign="top" align="middle"></td> 
            <td class="CeldaCopyright" valign="center" align="middle">copyright &copy; 2006 - General Equipment Linse bv</td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
</div> 
</body>
</html>
__________________
saludos