duanlaofu4108 2013-11-17 07:55
浏览 28
已采纳

当我上网时,表格行动无效

i m using 000webhost.com for testing my website... when i was using localhost the form was working properly.. link to the testing website

the errors which it shows are jquery ajax based... i don't think there is any problem in ajax, i think the form is not calling action

form...

<form action="login.php" method="post" id="login">
    <input id="email" placeholder="E-mail" type="text" name="em" />
    <input id="email" placeholder="Password" type="password" name="pwd"/>
    <div class="txt1"><input type="checkbox" name="check" />Keep me logged in |<a href="#"> Forgot Password ?</a></div>
    <input type="submit" id="loginButton" value="Login" name="log" />
    </form>

login.php page..

<?php
session_start();
include "incfiles/connection.php";
$user_login=$_POST['em'];
$password_login=$_POST['pwd'];
$password_login = md5($password_login);

if(empty($user_login) || empty($password_login))
{
die (retmsg(0,"Please fill Email and Password"));
}

$query = mysqli_query($con,"select * from registration where email='$user_login' and password='$password_login'");
$read = mysqli_num_rows($query);

if(!$read)
{
    die (retmsg(0,"Incorrect Email or Password"));
}
else
{
    while($row = mysqli_fetch_array($query)){ 
         $id = $row["id"];
    }
     $_SESSION["id"] = $id;
     $_SESSION["user_login"] = $user_login;
     $_SESSION["password_login"] = $password_login;
     if (isset($_SESSION["user_login"]) && isset($_SESSION["password_login"]))
     {echo retmsg(1,"profile.php?id=$id");}
 }

 function retmsg($status,$txt)
 {
return json_encode(array('status' => $status, 'txt' => $txt));
 }
 ?>
  • 写回答

1条回答 默认 最新

  • dongtao9158 2013-11-17 08:01
    关注

    I looked at your site. The response from your server includes

    Access denied for user 'root'@'localhost' (using password: NO) 
    

    Check the database login credentials you are using, and ensure that you are using a password to log in to the database.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度