我提交表单,像这样: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">
那么,有没有在那里的一些标记,必须要通过,否则你会得到错误载入页面
,或者更重要的是,我可以绕过这一点的同时我执行我的日志代码然后回到它...如果是这样,怎么样?
已更新的问题 –