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. <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
7 Replies
Jochem
Jochem2mo ago
you can link to a github repo, upload your source files as attachments, or send more code in subsequent messages also, you'll have to be more clear than "it doesn't work". What doesn't work? What errors are you getting? What behavior is happening that you aren't expecting, or isn't happening that you are expecting?
MoreThanGodly
MoreThanGodlyOP2mo ago
https://github.com/MoreThanGodly/help heres repo with source code so you can take look
GitHub
GitHub - MoreThanGodly/help
Contribute to MoreThanGodly/help development by creating an account on GitHub.
MoreThanGodly
MoreThanGodlyOP2mo ago
basicly nothing, website just loads and times out, my databes recives no info, i think i didnt connect it propertly
ἔρως
ἔρως2mo ago
are you sure the server name is correct?
MoreThanGodly
MoreThanGodlyOP2mo ago
i dont know idk if its localhost or hostinger`s dns as ive said i am new
ἔρως
ἔρως2mo ago
you should have all the information in the management thingy
MoreThanGodly
MoreThanGodlyOP2mo ago
okay thy ill be back if i dont fix it
Want results from more Discord servers?
Add your server