它在我的iPhone 3GS上运行得很好,但有几个iPhone 4及以上的员工无法通过safari登录我的网站,因为他们的登录凭据没有保存到$ _SESSION。如果他们将Chrome下载到他们的手机上就行了。
知道如何让这个工作吗?
当用户尝试登录时,他们的凭据首先会被验证为准确无误,并且当他们被发送到:
validate_login.php
<?php
session_start();
// sent from the login form
// employee id and username
$employeeId = $_POST['employee_id'];
$password = $_POST['password'];
//make connection to database, bail if no connection
$connection = odbc_pconnect('workorders','','');
if (!$connection) { exit("Connection Failed: " . $connection); }
//retrieve usernames and passwords
$sql = "SELECT * FROM LoginTable WHERE EmployeeID='$employeeId' and Password='$password'";
$rs = odbc_exec($connection, $sql);
if (!$rs) { exit("Error in SQL"); }
if(odbc_fetch_row($rs)) {
// register employeeId and password in session cookie and redirect to homepage
$_SESSION['employee_id'] = $employeeId;
header("location:../../home.php");
}
else {
header("location:../../login.php?error=0");
}
//close connection
odbc_close($connection);
&GT;
这就像你一样简单......任何想法为什么它不起作用?当我在每个页面顶部检查他们登录时:
<?php
session_start();
//validate user logged in; if not, redirect to login
if(!isset($_SESSION['employee_id'])){
header("location:login.php");
}
&GT;
它只是认为他们没有登录并将它们退回到login.php
同样,据我所知,对于较新的iPhone,这只是一个问题。建议?