require_once("config.php");
if(isset($_POST['go']))
{
$np = $_POST['nm'];
$ps = $_POST['pass'];
$np = mysqli_real_escape_string($np);
$ps = mysqli_real_escape_string($ps);
$q = "SELECT * FROM `pilots` WHERE `name`='$np' AND `pass`='$ps'";
$query = mysqli_query($q);
if(mysqli_num_rows($query))
{
$_SESSION['login'] = $np;
header("Location:index.html");
}
else
echo 'oi';
}
これは、mysqli に切り替えた後の私のログインであり、動作しません。これは、config.php で必要な場合の接続です。
session_start();
error_reporting(false);
$connection[0] = 'localhost';
$connection[1] = 'michael';
$connection[2] = '123123';
$connection[3] = 'aodpanel';
mysqli_real_connect($connection[0],$connection[1],$connection[2],$connection[3]);
//mysql_connect($connection[0],$connection[1],$connection[2]) or die;
//mysql_select_db($connection[3]);