Commit eaf564e9 authored by sawmi.rajapaksha-m's avatar sawmi.rajapaksha-m

Upload New File

parent 13e93283
<?php
session_start();
$valid_email = "user@example.com";
$valid_password = "password123";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$password = $_POST['password'];
if ($email === $valid_email && $password === $valid_password) {
$_SESSION['user'] = $fullname;
echo "<script>alert('Welcome, $fullname! Login successful.'); window.location.href='../index.html';</script>";
} else {
echo "<script>alert('Invalid email or password. Try again.'); window.location.href='../login.html';</script>";
}
}
?>
<?php
session_start();
$valid_email = "user@example.com";
$valid_password = "password123";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$password = $_POST['password'];
if ($email === $valid_email && $password === $valid_password) {
$_SESSION['user'] = $fullname;
echo "<script>alert('Welcome, $fullname! Login successful.'); window.location.href='../index.html';</script>";
} else {
echo "<script>alert('Invalid email or password. Try again.'); window.location.href='../login.html';</script>";
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment