Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/02/2011, 14:09
JaineOne
 
Fecha de Ingreso: febrero-2011
Ubicación: en mi casa
Mensajes: 1
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: No puedo introducir datos a mysql por medio de PHP y HTML

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<li><h2>CLIENTES</h2></li>
<p>Para dar de alta al cliente en el sistema, por favor ingrese los datos que se le piden:</p>
<form action="Alta_clientes.php" method="post" >
Clave_cliente:
<input type="text" name="txtclave_cliente"><br>
Nombre:
<input type="text" name="txtnombre"><br>
Direccion:
<input type="text" name="txtdireccion"><br>
Telefono:
<input type="text" name="txttelefono"><br>
Productos:
<input type="text" name="txtproductos"><br>
<input type="submit" value="Aceptar" name="btnboton">
</p>
</form>
</FONT></FONT></FONT></P>
</form>
</body>
</html>

----------------------------------------------------------

<?php
$conectar=mysql_connect("servidor","usuario","pass word");
mysql_Select_db("midatabase",$conectar);

$cadena="insert into cliente(claveCliente,nombre,direccion,telefono,pro ductos)".
"values(".$_POST["txtclave_cliente"].",".$_POST["txtnombre"].",".$_POST["txtdireccion"].",'".$_POST["txttelefono"]."','".$_POST["txtproductos"]."');";

mysql_query($cadena,$conectar);


echo "<center>CLIENTE REGISTRADO<br>";
echo "<br><center><A href=Clientes.html>REGRESAR</A>";


?>

Ojala te sirva saludos !!!