Muchas gracias.
Ya he modificado las partes del código que me comentabas. De todos modos, el error que da es en la siguiente linea:
Código HTML:
<span style="margin-left:280px;"><button type="submit"><br/>Guardar<br/><br/></button>
<button type="reset"><br/> Borrar <br/><br/></button></span>
No entiendo por que. De momento el código queda así:
Código HTML:
<div class="contenedor_contenidos">
<?php
$conexion=mysql_connect("localhost","root","") or die("Problemas en la conexion");
mysql_select_db("clientes",$conexion) or die("Problemas en la seleccion de la base de datos");
if($_REQUEST[codigo]=="-")
{
mysql_query("insert into clientes(nombre,cif,direccion,codigo_postal,ciudad,telefono,fax,email,fecha_alta) values
(".$_REQUEST['nombre'].",".$_REQUEST['cif'].",".$_REQUEST['direccion'].",".$_REQUEST['cp'].",".$_REQUEST['ciudad'].",".$_REQUEST['telefono'].",".$_REQUEST['fax'].",".$_REQUEST['email'].",date(d/m/y))",
$conexion) or die("Problemas en el select".mysql_error());
mysql_close($conexion);
echo "El cliente ha sido añadido.";
}
else
{
$registros=mysql_query("select * from clientes where nombre='$_REQUEST[nombre]'",$conexion) or die("Problemas en el select:".mysql_error());
if ($reg=mysql_fetch_array($registros))
{
$registros=mysql_query("update clientes set cif=".$_REQUEST['mailnuevo']." where nombre=".$_REQUEST['nombre']."",$conexion) or die("Problemas en el select:".mysql_error());
echo "El mail fue modificado con exito";
}
?>
<div class="contenidos"><br/><br/><br/><form style="margin-left:200px;" method="post" action="guardar-cliente.php">
Código: <input type="text" name="codigo" size="20" value="-"> <span style="margin-left:190px;" >Núm. albaranes: <input type="text" name="num_albaranes" size="20" value="0"/></span>
<br/><br/><br/>
<button type="submit">Nombre: </button> <input type="text" name="nombre" size="60"> <span style=" margin-left:10px;" >CIF: <input type="text" name="cif" size="20" /></span>
<br/><br/><br/>
Dirección: <input type="text" name="direccion" size="50" /><br/><br/>
C.P.: <input type="text" name="cp" size="10" /> <span style="margin-left:10px;">Ciudad: <input type="text" name="ciudad" size="30" /></span>
<br/><br/><br/>
Teléfono: <input type="text" name="telefono" size="20" /> <span style="margin-left:20px;">Fax: <input type="text" name="fax" size="20" /></span><br/><br/>
E-mail: <input type="text" name="email" size="55" />
<br/><br/> <span style="margin-left:420px;">Fecha de alta: <input type="text" name="fecha_alta" value="dd/mm/aa"/></span><br/><br/>
<span style="margin-left:280px;"><button type="submit"><br/>Guardar<br/><br/></button>
<button type="reset"><br/> Borrar <br/><br/></button></span>
</form></div>
Por qué creeis que puede ser ese error? Muchas gracias!