到目前为止,我有......
$q = $dbc -> prepare("SELECT * FROM accounts WHERE email = ?");
$q -> execute(array($_POST['email']));
$details = $q -> fetch(PDO::FETCH_ASSOC);
session_start();
$_SESSION['username'] = $details['username'];
$_SESSION['email'] = $details['email'];
$_SESSION['password'] = $details['email'];
header('location:/home?account='.$details[\'username\']');
exit();
我想将用户名添加到每个登录的查询字符串中。我哪里错了?
提前致谢:)
答案 0 :(得分:5)
它的
header('Location: /home?account='.$details['username']);
答案 1 :(得分:2)
header("Location:/home?account=$details['username']");
你应该使用完整的URL或相对的
答案 2 :(得分:0)
header('location:/home?account='.$details['username']);
)
答案 3 :(得分:0)
header("Location:/home?account={$details['username']}");
应该可以正常工作。