0

I was running this php file correctly and it showed up on the browser yesterday, but today, all of a sudden, I wasn't able to see the file correctly and also couldn't find the code in the source code via browser.

Also, this is the tutorial I was following: https://www.youtube.com/watch?v=hAkKC8DKN9A

Here is the code:

<?php
error_reporting(E_ALL ^ E_NOTICE);
session_start();
?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Member System - Log In</title>
</head>
<body>
    <?php

    $form = "<form action='./login.php' method='post'>
    <table>
    <tr>
        <td>Username:</td>
        <td><input type='text' name='user' /></td>
    </tr>
    <tr>
        <td>Password:</td>
        <td><input type='password' name='password' /></td>
    </tr>
    <tr>
        <td></td>
        <td><input type='submit' name='loginbtn' value='Login' /></td>
    </tr>
    </table>
    </form>";

    if ($_POST['loginbtn']) {
        $user = $_POST['user'];
        $password = $_POST['password'];

        if ($user) {
            if ($password) {

                require("connect.php");

                password = md5 (md5("kjfiufj".$password."Fjf56fj"));

                echo "$password";

                $query = mysql_query("");

                mysql_close();
            }
            else 
                echo "You must enter your password. $form";
        }
        else
            echo "You must enter your username. $form";
    }
    else 
        echo $form;

    ?>
</body>

</html>
1
  • this code is totally unsafe to be used as a live site Commented Jun 16, 2015 at 3:04

1 Answer 1

2

PHP Parse error: syntax error, unexpected '=' on line 41. Replace

password = md5 (md5("kjfiufj".$password."Fjf56fj")); to

$password = md5 (md5("kjfiufj".$password."Fjf56fj"));

Sign up to request clarification or add additional context in comments.

3 Comments

Thank You! This solution worked! I can't make it the answer right now though :/
:) no problem... Keep coding.
@StephenKim having used error reporting, would have signaled an undefined constant password notice. php.net/manual/en/function.error-reporting.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.