Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <DOCTYPE! html>
  2. <html lang="es">
  3.  
  4. <head>
  5. <title>Universalistas</title>
  6. <meta charset="utf-8"/>
  7. </head>
  8.  
  9. <body>
  10. <p>hola</p>
  11.  
  12. <?php
  13.  
  14. $host = "localhost";
  15. $user = "universalistas";
  16. $pass = "u12345";
  17. $name = "universalistas";
  18.  
  19.  
  20. $con = mysqli_connect($host, $user, $pass, $name);
  21.  
  22. if(mysqli_connect_errno()) echo "" . mysqli_connect_error();
  23. if(mysqli_ping($con)) echo "ok!";
  24. else echo "" . mysqli_error($con);
  25.  
  26. /*$user = "test";
  27. $password = "test";
  28. $mail = "tes@test.test";
  29. $name = "test";
  30. $lastname = "test";
  31. $origin = "test";
  32. $area = "test";*/
  33.  
  34. $conn = new mysqli($host, $user, $pass, $name);
  35.  
  36. $reg = mysqli_query($conn, "select * from users;");
  37. if($reg)
  38. {
  39. echo "<script>alert('Usuario registrado correctamente.');
  40. window.location.href = 'index.php';</script>";
  41. }
  42. else
  43. {
  44. echo "ร‘o"/*"<script>alert('ยกHa ocurrido un error y no se registraron los datos!');
  45. window.location.href = 'index.php';</script>"*/;
  46. }
  47.  
  48. ?>
  49.  
  50.  
  51. </body>
  52.  
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement