Parse error: syntax error, unexpected ‘}’ in C:xampphtdocsMTDregister.php on line 24. I dont’t know whats wrong

Question

i get this error when run my php Parse error: syntax error, unexpected ‘}’ in C:xampphtdocsMTDregister.php on line 24

here is my coding, please help me.

<?php
session_start();
include "db_conn.php"; //connect database
$db = mysqli_connect($sname, $unmae, $password, $db_name);


if (isset($_POST['signup'])) {
    session_start();
    $username = mysql_real_escape_string($_POST['user_name']);
    $email = mysql_real_escape_string($_POST['email']);
    $password = mysql_real_escape_string($_POST['password']);
    $password2 = mysql_real_escape_string($_POST['password2']);

    if ($password == $password2) {
        //create user
        $password = md5 ($password); //hash password before storing for security
        $sql= "INSERT INTO users(user_name, email, password) VALUES ('$username','$email', '$password')";
        mysqli_query ($db, $sql);
        $_SESSION['message'] = "You are now registered";
        $_SESSION['username'] = $username;
        header ("location : index.html")
     //redirect to login page
  
    }
    else{
        //failed
        $_SESSION['message'] = "The passwords do not match";
    }
    }

?>

0
sal 4 months 2020-12-22T00:10:19-05:00 0 Answers 5 views 0

Leave an answer

Browse
Browse