Professional Documents
Culture Documents
20bca1331 2.3 Web
20bca1331 2.3 Web
(20BCA1331
2. Task to be done:
Create the database connection between login and registration form and
database using PHP and MySQL.
3. Concept used:
The GET method refers to a HyperText Transfer Protocol (HTTP) method
that is applied while requesting information from a particular source.
Admin is the role with the highest level of access to your website.
<?php
$server = "localhost";
$username = "root";
$DB = "test";
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
} else {
?>
<script>
alert("Database Connected successfully");
</script>
<?php
}
?>
SIGNUP PAGE
<?php
include 'CTNavbar.php';
?>
<?php
include 'DatabaseConnection.php';
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$user = $_POST['user'];
$email = $_POST['email'];
$password = $_POST['password'];
$insertQ = "insert into
crazytaxies(name, user, email, password) values('$name', '$user',
'$email', '$password')";
if ($res) {
?>
<script>
alert("You are successfully registered");
</script>
<?php
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
mysqli_close($conn);
?>
<div class="main-wrapper">
<div class="form-container">
<form action="" method="POST">
<h3 class="text-uppercase">Signup</h3>
<!-- Name input -->
<div class="form-outline my-1">
<input type="text" name="name" class="form-control" />
<label class="form-label"
for="registerName">Name</label>
</div>
<label class="form-label"
for="registerRepeatPassword">Repeat password</label>
</div>
<!-- Checkbox -->
<div class="form-check d-flex justify-content-center mb-
4">
<input class="form-check-input me-2" type="checkbox"
value="" id="registerCheck" />
<label class="form-check-label" for="registerCheck">
I have read and agree to the terms
</label>
</div>
5. Result/Output/Writing Summary:
Registration Form
Database
Learning outcomes (What I have learnt):