2015-04-19 20:22
浏览 109


I am new to PHP. I have worked a little before on it , but not much. Now, I have IIS server installed in my machine and it consumes port 80 and for that reason I have changed the wamp server's port to 8080 in the config file.

Now ,what I have is a simple login form.The HTML markup looks like this :


    <script type="text/javascript">
        alert("Username and/or Password is incorrect!Please try again!");
<form method="post" action="verifyUser.php">

<div class="container">
        <div class="card card-container">
            <!-- <img class="profile-img-card" src="//" alt="" /> -->
            <img id="profile-img" class="profile-img-card" src="//" />
            <p id="profile-name" class="profile-name-card"></p>
            <form class="form-signin">
                <span id="reauth-email" class="reauth-email"></span>

                <input type="email" name="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus><br>
                <input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password" required>

                <div id="remember" class="checkbox">

                        <input type="checkbox" value="remember-me"> Remember me


                <button class="btn btn-lg btn-primary btn-block btn-signin" type="submit">Sign in</button>
            </form><!-- /form -->
            <a href="#" class="forgot-password">
                Forgot the password?

        </div><!-- /card-container -->
    </div><!-- /container -->


and the PHP file, verifyUser.php looks like this :


    $email = $_POST["email"];
    $pass = $_POST["password"];

    $con = mysqli_connect("localhost","root","","user",8080)  or die("Some error occurred during connection " . mysqli_error($con));

    $result_row = mysqli_query($con,"select * from info where Email='$email' and Password='$pass'");

    if($row = mysqli_fetch_array($result_row)){
        $_SESSION["existing_user"] = $row['Name'];
        $_SESSION["email"] = $row['Email'];
        header("location : home.php");

Now when I try to login, I get the error :

Warning: mysqli_connect(): MySQL server has gone away in C:\wamp\www\verifyUser.php on line 7

My error screen looks like this : enter image description here

I have studied this error and tried all the alternatives , which doesn't seem to work.One of them was to make some changes in php.ini file, but doesn't seem to work either!

Can someone tell me why is this actually happening and the solution for it?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题