Ver Mensaje Individual
  #10 (permalink)  
Antiguo 21/06/2010, 16:42
shilen79
 
Fecha de Ingreso: octubre-2007
Mensajes: 118
Antigüedad: 16 años, 6 meses
Puntos: 11
Respuesta: Ayuda: Exportar a db el contenido de $_POST !

Pruebalo así a ver si te funciona:
Código PHP:
<?php
include "conexion.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']."') 
                "
) or die ("Problemas en el select"); 
$_POST=array(); // LIMPIO LAS ENTRADAS QUE HAYAN PODIDO INTRODUCIR
}
?>
<!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" action="">
Colocar aquí el nombre:<br>
<input type="text" name="body" size="30"><br>
<input type="submit" name="submit" value="Submit me!">
</form>
</body>
</html>
Si no te funciona, ves checkeando las variables mediante 'echo' para ver si realiza bien la conexion, el '$_post' te lo coge, etc... porque en un principio deberia funcionar...