Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
This question already has an answer here:
I'm having problem with my code on a line. An error pops up ,
Error :
Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\Patient Registration\server.php on line 23.
Please help.
I have tried to delete and alter what I could but nothing happened. Line 23 is the bold'ed' };
EDITED : Thanks for those who replied but can you guys check my code again? I encountered different errors this time.
Errors :
Notice: Undefined index: username in C:\xampp\htdocs\Patient Registration\server.php on line 14
Notice: Undefined index: email in C:\xampp\htdocs\Patient Registration\server.php on line 15
Notice: Undefined index: password in C:\xampp\htdocs\Patient Registration\server.php on line 16
Notice: Undefined index: password_confirm in C:\xampp\htdocs\Patient Registration\server.php on line 17
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\Patient Registration\server.php on line 36
Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) in C:\xampp\htdocs\Patient Registration\errors.php on line 15
php session_start(); //Variables declared $username = ""; $email = ""; $errors = array(); //Connect to database $db = mysqli_connect('localhost','root','','patient') or die("Could not connect to the database"); //Registeration area $username = mysqli_real_escape_string($db, $_POST['username']); $email = mysqli_real_escape_string($db, $_POST['email']); $password = mysqli_real_escape_string($db, $_POST['password']); $re_password = mysqli_real_escape_string($db, $_POST['password_confirm']); //Errors popup if(empty($username) || empty($email) || empty($password)) { array_push($errors, "Required field"); } if($password != $re_password) { array_push($errors, "Password must match"); } //Existing username check $user_check_query = "SELECT * FROM patient WHERE Patient Name = '$username' or Patient Email = '$email' LIMIT 1"; $result = mysqli_query($db, $user_check_query); $user = mysqli_fetch_assoc($result); if($user) { if($user['username'] === $username) { array_push($errors, "Username has already been used"); } if($user['email'] === $email) { array_push($errors, "Email has already been used"); } } //Successful registration if(count($errors) == 0) { $passwordhash = md5($password); //Password encryption $query = "INSERT INTO patient (Patient_Name, Patient_Email, Password) VALUES ('$username', '$email', '$password')"; mysqli_query REPLY 0 views 0 likes 0 shares Facebook Twitter Linked In WhatsApp
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.