Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <DOCTYPE! html>
- <html lang="es">
- <head>
- <title>Universalistas</title>
- <meta charset="utf-8"/>
- </head>
- <body>
- <p>hola</p>
- <?php
- $host = "xxxxxx";
- $user = "xxxxxx";
- $pass = "xxxxxx";
- $name = "xxxxxx";
- $con = mysqli_connect($host, $user, $pass, $name);
- if(mysqli_connect_errno()) echo "" . mysqli_connect_error();
- if(mysqli_ping($con)) echo "ok!";
- else echo "" . mysqli_error($con);
- /*$user = "test";
- $password = "test";
- $mail = "tes@test.test";
- $name = "test";
- $lastname = "test";
- $origin = "test";
- $area = "test";*/
- $conn = new mysqli($host, $user, $pass, $name);
- $reg = mysqli_query($conn, "select * from users;");
- if($reg)
- {
- echo "<script>alert('Usuario registrado correctamente.');
- window.location.href = 'index.php';</script>";
- }
- else
- {
- echo "Ño"/*"<script>alert('¡Ha ocurrido un error y no se registraron los datos!');
- window.location.href = 'index.php';</script>"*/;
- }
- ?>
- </body>
- </html>
- ini_set('display_errors', 1);
- error_reporting(E_ALL);
- try {
- $conn = new mysqli($host, $user, $pass, $name);
- $reg = mysqli_query($conn, "select * from users;");
- if($reg) {
- echo "Si";
- } else {
- echo "Ño";
- }
- } catch (Exception $exc) {
- echo '<pre>';
- var_export($exc);
- echo '<br>';
- }
Add Comment
Please, Sign In to add comment