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"、 URL: "conexion.php"、 キャッシュ:偽、 データ:FORMDATA、 成功:するonSuccess、 エラー:onErrorを }); –
することができます、はい。そのスクリプトブロック全体を必要とすべきではありません。どうした? – irama
"conexion.php"は電子メールとパスワードの値を受け取っていないので、 "Undefined"というエラーがあります –