Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/03/2015, 18:04
sarrhen
 
Fecha de Ingreso: mayo-2013
Ubicación: San Vicente
Mensajes: 127
Antigüedad: 11 años
Puntos: 1
Sonrisa ayudar al enviar por metodo POST

Necesito saber donde es mi error este es el formulario
Código HTML:
Ver original
  1. <form action="newEmptyPHP.php">
  2. id:<br>
  3. <input type="text" name="buscar" value="">
  4. <br>
  5. <input type="submit" value="Submit">
  6. </form>
y aqui recibo los datos
Código PHP:
Ver original
  1. <?php
  2.  
  3. $buscar = $_POST['buscar'];
  4.  
  5. $con = mysql_connect("localhost", "root", "12345");
  6. mysql_select_db("pruebas",$con);
  7.  
  8. $sql="SELECT * FROM presidents WHERE id = $buscar;";
  9. $rs= mysql_query($sql,$con);
  10.  
  11. if($row = mysql_fetch_array($rs)){
  12.     echo "<form  action=''' method='POST'>";
  13.     echo "ID : <input type='text' name='id' value='".$row[0]."'/>";
  14.     echo"<br/>";
  15.        echo "Nombre : <input type='text' name='Nombre' value='".$row[1]."'/>";
  16.         echo"<br/>";
  17.         echo "Nombre : <input type='text' name='Apellido' value='".$row[2]."'/>";
  18.          echo"<br/>";
  19.          echo "<input type='submit'value='Enviar'/>";
  20.          echo "</form>";
  21.     }
  22.        
  23. ?>