Guest User

Untitled

a guest
Dec 14th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <head>
  2. <title> Creacion de portal PHP y MySQL </title>
  3. </head>
  4. <h2> Formulario para insertar datos </h2>
  5. <?php
  6. $host = "127.0.0.1";
  7. $user = "root";
  8. $password = 1;
  9. $db = "Farmacia"
  10.  
  11. $Nombre=$_POST['Nombre'];
  12. $Accion = $_POST['Accion'];
  13. $IDLab = $_POST['IDLab'];
  14.  
  15. $enlace = mysql_connect($host, $user, $password);
  16. mysql_select_db($db, $enlace);
  17. $result = mysql_query("insert into Medicamentos(Nombre, Accion, IDLab) value
  18. ('$Nombre','$Accion','$IDLab')", $enlace);
  19. echo "Ha insertado los siguientes datos";
  20. echo "<br><br>";
  21. echo "Nombre del medicamento.......................: $Nombre";
  22. echo "<br>";
  23. echo "Accion del medicamento.......................: $Accion";
  24. echo "<br>";
  25. echo "ID del Laboratorio...........................: $IDLab";
  26. echo "<br>";
  27. echo "<br><br>";
  28. ?>
  29.  
  30. <a href = "http://localhost/Formularioinserta.htm"> Volver
Add Comment
Please, Sign In to add comment