Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/03/2005, 17:18
Jon4
 
Fecha de Ingreso: febrero-2005
Mensajes: 28
Antigüedad: 19 años, 2 meses
Puntos: 0
Veamos, te paso algo demasiado simple: son 2 archivos, un html y un php.
El 1º
Código:
<html>
<head>Add Post</head>
<body>
<form method="post" action="insert.php" target="_self">
Name :<input type="Text" name="NewName"><br>
Email :<input type="Text" name="NewEmail"><br>
Country :<input type="Text" name="NewCountry"><br>
Descripction :<textarea name="New"></textarea><br>
<input type="Submit" value="Send it!">
</form>
</body>
</html>
Ahora vamos al php
Código PHP:
<?php
//aqui pon tu script para conectar a tu base de datos
$name=$_POST['NewName'];
$descrip=$_POST['New'];
$email=$_POST['NewEmail'];
$country=$_POST['NewCountry'];
//INSERT TO esta divido en tres,  
$sql "INSERT INTO NombredeTabla (campo1, campo2, campo3, campo4 ) ";
$sql .= "VALUES ( '$name', '$descrip', '$email', '$country')";
$result mysql_query($sql);
echo 
"Thanks...\n";
?>
<SCRIPT LANGUAGE="JavaScript">
//se dirige a otra pagina 
location.href='index.php';
 </SCRIPT>
Adapta el script a tus necesidades. Espero que lo puedas entener y que te sirva. Exitos!