0
<!-- this is my conexion.html -->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"> </script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"></script>
</head>
<body>
<!-- call ajax page -->
<div data-role="page" id="callAjaxPage">
<div data-role="header">
<h1>Connexion</h1>
<a href="index.html" data-icon="home" data-iconpos="notext" class="ui-btn-right jqm-home">Home</a>
</div>
<div data-role="content">
<div data-role="collapsible" data-collapsed="false">
<h3>Sign in</h3>
<form id="callAjaxForm" method="post" action="conexion.php">
<div data-role="fieldcontain">
<label for="email">Email</label>
<input type="text" name="email" id="email" />
<label for="password">Password</label>
<input type="password" name="password" id="password" />
<h3 id="notification"></h3>
<button data-theme="b" id="submit" type="submit">Go</button>
</div>
</form>
</div>
<div data-role="collapsible" data-collapsed="true">
<h3>Create an account </h3>
</div>
</div>
<div data-role="footer">
<h1>Pied de page</h1>
</div>
</div>
</body>
</html>
<!--- this is my conexion.php -->
<?php
include('config.php');// connexion to mysql
$email = $_POST['email'];
$password = $_POST['password'];
$request=mysql_query("select * from utilisateur where nom='$email' and password='$password'");
$count=mysql_num_rows($request);
if ($count==0){
echo "User not found";
}
else echo "Utilisateur founded";
?>
所以我可以刪除它? $阿賈克斯({ 類型: 「POST」, 網址: 「conexion.php」, 緩存:假的, 數據:FORMDATA, 成功:的onSuccess, 錯誤:onerror的 }); –
應該可以,是的。你不應該需要整個腳本塊。它怎麼樣? – irama
當我這樣做,有一個錯誤「未定義」,因爲「conexion.php」沒有收到電子郵件和密碼值 –