我提交表單,像這樣:jQuery Mobile的 - 表單提交 - 加載頁面時出錯
<form action="userlogin.html" method="get" name="log_form" onsubmit="return form_val();">
這是所有好,然後它產生的cookie,如果日誌中正確的如下數據:
if ($email){ // 111
require '/php/lib/dbconnect.inc';
$email=strtolower($email);
$password=strtolower($password);
$result = mysql_query("SELECT name from users where (username = '$email' AND password = '$password')",$db);
if(!$result) { echo mysql_error(); exit; } // debug
$item = mysql_fetch_row($result);
$result_userid = mysql_query("SELECT user_id from users where (username = '$username' AND password = '$password')",$db);
if(!$result_userid) { echo mysql_error(); exit; } // debug
$item_userid = mysql_fetch_row($result_userid);
if ('0'==$item[0]){ // 33
$error .= "You typed the wrong email address or password, please check the information entered.<br><br><br>";
} // close 33
else { // 44
require '/php/lib/setup.inc';
$user = Encrypt_data ($item_userid[0]);
setcookie("user_cook", "$user", 0);
header("Location: /en/");
} // close 44
} // close 111
但是,我總是得到「錯誤加載頁面」,無論數據輸入是否正確,因此有些事情是不正確的,但是什麼?
另外,我還嘗試添加我的頭包括文件到該評估數據是否正確,其正常工作,但隨後我當然不能用header("Location: /en/");
所以我想澄清之前,等於是經過jQuery Mobile的標記,這一切工作正常和形式傳送數據,但它好像jQuery的需要的東西會看看其他數據...以下工作之前:
if ($email){ // 111
include '/home/twovo77/1NTJ3EJZ/php/nav/mobile_header.inc';
// require '/home/twovo77/1NTJ3EJZ/php/lib/dbconnect.inc';
$email=strtolower($email);
$password=strtolower($password);
,但沒有很好的作爲傳遞到標題
mobile_header.inc是:
<?
require '/php/lib/setup.inc';
require '/php/lib/dbconnect.inc'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content='width=device-width, initial-scale=1.0, maximum- scale=1.0, min-width=321px'>
<link rel="stylesheet" href="mobile.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-.0rc2.min.js">
</script>
</head>
<body>
<div data-role="page" id="foo" data-title="<? echo $page_title; ?>">
<a href="index.html"><div data-role="header" data-theme="c" style="height:50px; padding:3px;"><img src="/images/logo2.png"></div></a><!-- /header -->
<? echo $header_image; ?>
<div data-role="content"><div class="inner">
那麼,有沒有在那裏的一些標記,必須要通過,否則你會得到錯誤載入頁面
,或者更重要的是,我可以繞過這一點的同時我執行我的日誌代碼然後回到它...如果是這樣,怎麼樣?
已更新的問題 –