Please my it seems my code is wrong im trying to creat a signup php code that redirect to my index.php after user register

hear’s my code please help me

<?php $servername = "sql310.ezyro.com"; $usernamee = "ezyro_31808959"; $passwordd = "@prince157714#"; $database = "ezyro_31808959_survey"; // Create connection $conn = mysqli_connect($servername, $usernamee, $passwordd, $database); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } if(isset($_SESSION["username"])){ $username = $_POST["username"]; $email= $_POST["email"]; $password= $_POST["password"]; $query = "INSERT INTO `users` (`username`, `email`, `password`) VALUES ('$username', '$email', '$password')"; $result = mysqli_query($conn,$query); if($result){ $_SESSION["username"]==$username; header("Location: index.php"); } else{ die("could not sign up :" . $sql. "
" .mysqli_connect_error()); } } ?>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.