Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/11/2010, 09:17
Avatar de rickyper
rickyper
 
Fecha de Ingreso: abril-2009
Mensajes: 182
Antigüedad: 15 años, 1 mes
Puntos: 10
Respuesta: pero que estoy asiendo mal?

Primero tienes problema en tu formulario:
Código HTML:
Ver original
  1. <form id="form1" name="form1" method="post" action="prueba.php">
  2. <input type="text" value="" name="mario">
  3. <input type="submit" value="enter" >
  4. </form>

Segundo utiliza if:
Código PHP:
Ver original
  1. <?
  2.  
  3. if (isset($_POST['mario']))
  4. {
  5. $nombre = $_POST['mario'];
  6.  
  7.  
  8. $link=mysql_connect("localhost","root","");
  9.  
  10. mysql_select_db("prueba");
  11.  
  12. $sql="SELECT * FROM prueba_tabla";
  13.  
  14. $res=mysql_query($sql,$link);
  15.  
  16. mysql_query("INSERT INTO  prueba_tabla2(nombre) values('$nombre')");
  17.  
  18. echo "Hola mi nombre es ".$nombre."";
  19.  
  20. }
  21. else
  22. {
  23. Aqui el formulario
  24. }
  25.  
  26.  
  27. ?>
__________________
www.granideamillonaria.com