Guest User

Untitled

a guest
Oct 31st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <head>
  2. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  3. </head>
  4. <body>
  5.  
  6. <?php
  7.  
  8. $user="localhost";
  9. $username="root";
  10. $pass="";
  11. $db="surti_office";
  12.  
  13. $conexion=mysqli_connect($user,$username,$pass,$db)or die ("ERROR DE CONEXION");
  14. ?>
  15.  
  16. <?php
  17. $consultar="SELECT * FROM producto where total_oferta_iva >1 ORDER by idproducto desc limit 20";
  18. $resultado=$conexion->query($consultar);
  19. while ($resultados=$resultado->fetch_assoc()){
  20. ?>
  21. <form action="#" id="formulario">
  22.  
  23. <input type="text" id="input" name="<?php echo $resultados['idproducto']?>" value="<?php echo $resultados['idproducto']?>">
  24. <input type="submit" value="Enviar" />
  25. </form>
  26. <?php }?>
  27.  
  28. <script type="text/javascript">
  29. $(document).ready(function(){
  30. $("#formulario").submit(function(){
  31. var cadena="";
  32. cadena = $(this).serialize();
  33. alert(cadena);
  34. return false;
  35. });
  36. });
  37. </script>
Add Comment
Please, Sign In to add comment