Skip to content

Instantly share code, notes, and snippets.

@djoudi
Last active March 26, 2023 12:08
Show Gist options
  • Save djoudi/8928c464c3d338e26b4210eba2355d54 to your computer and use it in GitHub Desktop.
Save djoudi/8928c464c3d338e26b4210eba2355d54 to your computer and use it in GitHub Desktop.
<?php
session_start();
if (!isset($_SESSION["ecoin"])) {
header("Location:connect.php");
}
include "inc/header.php";
?>
<div>
<h1>Welcom To Admin</h1>
</div>
<?php include "inc/header.php" ?>
<?php
session_start();
const USER = "admin@admin.com";
const PASSWORD = "123456";
include "inc/header.php";
$u = (isset($_POST['user']))?$_POST['user']:null;
$p = (isset($_POST['pass']))?$_POST['pass']:null;
if ($u == USER && $p == PASSWORD) {
echo '<h3 class="ok">OK</h3>';
//echo md5($u);
$_SESSION['ecoin'] = md5($u);
header("Location:admin.php");
}else {
echo '<h3 class="error">NOT WORK</h3>';
}
?>
<div class="login">
<form action="" method="POST">
<div class="input">
User<input type="text" name="user">
</div>
<div class="input">
Password<input type="password" name="pass">
</div>
<button type="submit">Login</button>
</form>
</div>
<?php include "inc/header.php" ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment