Commit ee2547e7 by zekena

touches

parent afb01805
@import url('https://fonts.googleapis.com/css?family=Dosis|Passion+One|Roboto+Slab');
* {
-moz-box-sizing: border-box;
......@@ -92,13 +93,14 @@
}
#login form input[type=text], input[type=password]{
background-color: #25405f;
border-radius: 60px 60px 60px 60px;
background-color: #a6b2d085;
color: #30363b;
margin-bottom: 1em;
padding: 25px;
width: 225px;
margin-left: 25px;
width: 280px;
border-block: radius:3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
input[type=button] {
......@@ -109,16 +111,20 @@
color: rgb(234, 182, 182);
font-weight: bold;
margin-bottom: 2em;
width: 280px;
font-family: 'Dosis',serif;
}
#login form input[type="submit"]:hover {
background-color: #be3636;
input[type=button]:hover {
background-color: #a6b2d085;
opacity: 0.7;
color: #100f0f;
font-family: 'Passion one',cursive;
font-size:30px;
}
#login form input[type=text], input[type=password]{
outline: none;
box-shadow: 0.2rem 0.8rem 1.6rem var(--colorPrimary600)}
#login > p {
text-align: center;
}
......@@ -126,4 +132,6 @@
#login > p span {
padding-left: 5px;
}
\ No newline at end of file
#login form input[type=text]:focus::placeholder-shown, input[type=password]:focus::placeholder-shown {
color: transparent;
}
<?php
$from_value = $_POST['from_value'];
$from_unit = $_POST['from_unit'];
$to_unit = $_POST['to_unit'];
if (is_numeric(($from_unit))){
echo "Must be a digit";
};
?>
<?php
//connection variables
define('DB_NAME','loginsystem');
define('DB_USER', 'root');
define('DB_PASSWORD','root');
define('DB_HOST','localhost');
$link = new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die("Error " . mysqli_error($link));
/*
if(mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_errno().')'.mysqli_connect_error());
}
*/
?>
\ No newline at end of file
<?php
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Signup</title>
<link rel="stylesheet" href="../css/login_style.css" media="screen" type="text/css" />
</head>
<body>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Login</title>
</head>
<body>
<div class="container">
<div id="login">
<form action="" method="get">
<fieldset class="clearfix">
<p><input type="text" name="sign_username" placeholder="Username"></p>
<p><input type="password" name="sign_password" placeholder="Password"></p>
<p><input type="submit" name="submit" placeholder="Submit"></p>
</fieldset>
</form>
</div>
</div>
</body>
</html>
</body>
</html>
\ No newline at end of file
<?php
require('db.php');
function protect($string){
function protect($string)
{
$string = mysql_real_escape_string(trim(strip_tags(addslashes($string))));
return $string;
}
session_start();
if (isset($_SESSION['loggedIN'])){
header('Location: ../home.php');
exit();
}
if (isset($_POST['login'])){
$username = $link->real_escape_string($_POST['usernamePHP']);
$email = $link->real_escape_string($_POST['emailPHP']);
$password = $link->real_escape_string($_POST['passwordPHP']);
$data = $link->query("SELECT id FROM users WHERE username='$username' AND email='$email' AND password='$password'");
if ($data->num_rows > 0){
$_SESSION['loggedIN'] = '1';
$_SESSION['username'] = $username;
$_SESSION['email']= $email;
$_SESSION['password']= $password;
exit('Success..');
} else{
exit('failed');
}
session_start();
if (isset($_SESSION['loggedIN'])) {
header('Location: ../home.php');
exit();
}
if (isset($_POST['login'])) {
$username = $link->real_escape_string($_POST['usernamePHP']);
$email = $link->real_escape_string($_POST['emailPHP']);
$password = $link->real_escape_string($_POST['passwordPHP']);
$data = $link->query("SELECT id FROM users WHERE username='$username' AND email='$email' AND password='$password'");
if ($data->num_rows > 0) {
$_SESSION['loggedIN'] = '1';
$_SESSION['username'] = $username;
$_SESSION['email'] = $email;
$_SESSION['password'] = $password;
exit('Success..');
} else {
exit('failed');
}
}
?>
<!DOCTYPE html>
......@@ -36,65 +36,62 @@ function protect($string){
<title>Login</title>
<link rel="stylesheet" href="../css/login_style.css" media="screen" type="text/css" />
<link rel="stylesheet" href="../css/login_style.css" media="screen" type="text/css" />
</head>
<body>
<div class="container">
<div id="login">
<form action="login.php" method="POST" >
<p><input type="text" id="username" name="username" placeholder="Username"></p>
<p><input type="text" id="email" name="email" placeholder="Email"></p>
<p><input type="password" id="password" name="password" placeholder="Password"></p>
<p><input type="button" name="submit" value="Sign in" id="login"></p>
<p><a href="signup.php">SIGN UP NOW</a></p>
<p><button id="continue">Continue without Logging in</button></p>
</form>
<p id="response"></p>
</div>
<div class="container">
<div id="login">
<form action="login.php" method="POST">
<p><input type="text" id="username" name="username" placeholder="Username"></p>
<p><input type="text" id="email" name="email" placeholder="Email"></p>
<p><input type="password" id="password" name="password" placeholder="Password"></p>
<p><input type="button" name="submit" value="Sign in" id="login"></p>
<p><button id="continue">Continue without Logging in</button></p>
</form>
<p id="response"></p>
</div>
</div>
<script src="../js/jquery.js"></script>
<script type="text/javascript">
// document.getElementById("continue").onclick = function () {
// };
$(document).ready(function(){
$("#continue").on('click',function(){
window.location="../home.php";
$(document).ready(function() {
$("#continue").on('click', function() {
window.location = "../home.php";
});
$("#login").on('click',function(){
$("#login").on('click', function() {
var username = $("#username").val();
var email = $("#email").val();
var password = $("#password").val();
if (email.length == 0 || password.length == 0 || username.length == 0)
alert('Please check input');
else{
$.ajax(
{
url: 'login.php',
method: 'POST',
data: {
login: 1,
emailPHP : email,
usernamePHP : username,
passwordPHP : password
},
success: function (response) {
$("#response").html(response);
if(response.indexOf('success')> -1){
window.location = '../home.php';
}
},
dataType: 'text'
}
);
else {
$.ajax({
url: 'login.php',
method: 'POST',
data: {
login: 1,
emailPHP: email,
usernamePHP: username,
passwordPHP: password
},
success: function(response) {
$("#response").html(response);
if (response.indexOf('success') > -1) {
window.location = '../home.php';
}
},
dataType: 'text'
});
}
});
});
</script>
</body>
</html>
</body>
</html>
\ No newline at end of file
<?php
session_start();
unset($_SESSION['loggedIN']);
session_destroy();
header('Location: login.php');
exit();
?>
\ No newline at end of file
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 sign in to comment