我想将用户重定向到由他/她的电话号码命名的文件夹(用户注册时创建的文件夹),这是我的代码的一部分:
if (count($errors) == 0) {
$password = md5($password);
$query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$results = mysqli_query($db, $query);
if (mysqli_num_rows($results) == 1) {
$row=mysql_fetch_assoc($results);
$folder = $row['phone'];
$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
header("location:$folder"."/index.php");
它会将用户重定向到 /index.php