Ver Mensaje Individual
  #9 (permalink)  
Antiguo 21/06/2010, 16:21
xx7er
 
Fecha de Ingreso: julio-2009
Mensajes: 44
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Ayuda: Exportar a db el contenido de $_POST !

Lo dejé asi:



index.php:

Cita:
<?php

include "conexion.php";
include "plantilla.php";

if(!empty($_POST)){
$db = mysql_connect($hostname, $db_user, $db_password) or die ("No se puede conectar a la base de datos! :s.");
mysql_select_db($db_table,$db);

mysql_query("insert into smf_messages(body) values ($_POST['body'])", $db) or die("Problemas en el select".mysql_error());
}

?>

y plantilla.php:
Cita:
<!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>sitio</title>
</head>

<body>
<form method="POST">
Colocar aquí el nombre:<br>
<input type="text" name="body" cols="45" rows="5"><br>
<input type="submit" name="submit" value="Submit me!">
</form>
</body>
</html>
pero sigue la pagina en blano, y tal cual me lo enviaste tmb sucede lo mismo,
GRACIAS!! (: