- 分享
- 0
- 人气
- 0
- 主题
- 9
- 帖子
- 313
- UID
- 185538
- 积分
- 1174
- 阅读权限
- 105
- 注册时间
- 2008-12-12
- 最后登录
- 2016-1-13
- 在线时间
- 9168 小时
      
|
本帖最后由 你终究不属于我 于 2013-6-24 07:02 PM 编辑
刚好之前有
界面自己设计,给你最基本login button call的function
- <script type="text/javascript">
- function login(){
- var username=$('#username').val(),password=$('#password').val();
- $.ajax({
- url:'?abc',
- data:{
- username:username,
- password:password
- },
- success:function(data){
- if(data==true){
- window.location='?loc=xxx';
- }else{
- $("#login_error").html('<span>Wrong Username And Password.</span>');
- }
- }
- })
- }
- </script>
复制代码 这个是abc.php的code
- <?php
- $sql = ""; //do select statement
- $rs = mysql_query($sql);
- $sql1 = ""; //do select statement
- $rs1 = mysql_query($sql1);
- $row1 = mysql_fetch_array($rs1);
- if($rs && mysql_num_rows($rs)>0){
- $row = mysql_fetch_array($rs);
- if($row["xxx"]==$_GET["password"]){
- print true;
- }else{
- print false;
- }
- } else {
- print false;
- }
- ?>
复制代码 p/s:供参考,copy&paste是不会function的。 |
|