Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/05/2010, 10:15
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 2 meses
Puntos: 6
Respuesta: Insertar texto en BD mysql

vale entonces seria algo asi el codigo completo:


Formulario.html
Código HTML:
<table width="343" height="143" border="0">  
  <tr> <td><form name="form1" method="post" action="enviar.php">
  <table width="338" height="99" border="0">
    <tr>
      <td>Texto a Mostrar:</td>
      <td><input name="nombre" type="text" id="nombre"></td>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
      <td><input type="submit" name="Submit" value="Mostrar"></td>
      <td>&nbsp;</td>
    </tr>
  </table>    
</form></td>  
</tr> </table> 

Enviar.php
Código PHP:
<?php
//Conectar a Mysql
mysql_connect("host","usuario","password");

//Seleccionar Base de datos

mysql_select_db("mi_base_datos"); 

//Imprimir en Base de datos

      
mysql_query("INSERT INTO tabla (campoTexto) VALUES ('".$_POST['nombre']."')");
?>