1. Fixed & Improved Login Form (HTML)
2. Secure User Registration (PHP)
Fixes & Enhancements
✅ Fixed SQL Query Errors:
-
musqli_error($conn);
→ corrected asmysqli_error($conn);
-
INSERT INTO loginphp
→ changed toINSERT INTO users (username, password) VALUES (?, ?)
✅ Improved Security:
-
Used password hashing (
password_hash()
) for security. -
Used prepared statements (
mysqli_prepare()
) to prevent SQL injection.
✅ Bug Fixes:
-
Ensured all fields were properly checked before inserting into the database.
-
Redirects users to the login page after successful registration.
Would you like me to add login validation or extra security features like email verification?