How to make simple login system with php
I have made small project, website and frontend is all done, now as im new to backend i need to make simple system for logging in and registering, i realy cloudnt figure it out, tried using chatgpt but still it doesnt work, its on hostinger i will provide some relevant code for you to examine it.
this is a part of code as i cant show more bc of discord message limits,
here is some of php
... there is rest, if you need some more dm me ill send you files needed so you can take look, thy
<form action="register.php" method="POST" autocomplete="off" id="frmContactus" class="contact__form mt-8 mt-lg-10 text-start">
<div class="d-flex flex-column gap-5 gap-lg-6">
<div class="row g-5 g-lg-6">
<div class="col-sm-6 col-md-12 col-xl-6">
<div class="single-input">
<label class="mb-2 nw1-color" for="fname">Ime</label>
<input type="text" class="fs-six-up bg_transparent" name="fname" id="fname" placeholder="Name" required>
</div>
</div>
</form>this is a part of code as i cant show more bc of discord message limits,
here is some of php
<?php
// Database credentials
$servername = "";
$database = ""; //
$username = ""; //
$password = ""; //
$conn = mysqli_connect($servername, $username, $password, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$fname = mysqli_real_escape_string($conn, $_POST['fname']);
$lname = mysqli_real_escape_string($conn, $_POST['lname']);
$uname = mysqli_real_escape_string($conn, $_POST['uname']);
$password = mysqli_real_escape_string($conn, $_POST['password']);
$cpassword = mysqli_real_escape_string($conn, $_POST['cpassword']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
... there is rest, if you need some more dm me ill send you files needed so you can take look, thy
