Config.php
Código PHP:
$servername = "localhost";
$username = "root";
$password = "hola123";
// Create connection
$conn = new mysqli($servername, $username, $password);
Código PHP:
Ver original
require_once '../kernel/config.php'; $username = $_GET['username']; $encoded_pwd = $_GET['password']; $q = $conn->prepare("SELECT * FROM account WHERE account_id = ? AND passwd = ?"); $q->bind_param('s',$username,$encoded_pwd); $q->execute(); $result = $q->get_result(); if($result->num_rows > 0) { $_SESSION['username'] = $username; echo 0; } else { echo 1; } } /*else { header('location: ../../login.php'); }*/
Espero que me puedan echar una mano. y Gracias =)