Skip to content

Commit

Permalink
Sistema de login
Browse files Browse the repository at this point in the history
  • Loading branch information
kaway404 authored Nov 13, 2017
1 parent a64fad9 commit bea5ce6
Show file tree
Hide file tree
Showing 6 changed files with 426 additions and 76 deletions.
116 changes: 109 additions & 7 deletions account.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<?php
if(isset($_COOKIE['iduser']) and (isset($_COOKIE['inisession']))){
echo '<script>location.href="dashboard.php";</script>';
}
?>

<head>
<title>
Netflix
Expand Down Expand Up @@ -63,8 +69,8 @@
<body>

<div class="header-al-home-a">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 81.387"><g fill="#b81d24"><path d="M256.09 76.212c4.178.405 8.354.84 12.52 1.29l9.198-22.712 8.743 24.807c4.486.562 8.97 1.152 13.44 1.768l-15.328-43.501L299.996 0H287.01l-.135.186-8.283 20.455L271.32.003h-12.822l13.237 37.565-15.644 38.644zM246.393 75.322V0h-12.817v74.265c4.275.33 8.552.684 12.817 1.056M150.113 71.11c3.46 0 6.916.026 10.366.054V43.492h15.397V31.708H160.48v-19.91h17.733V0h-30.6v71.12c.831 0 1.666-.013 2.5-.01M110.319 71.83c4.27-.152 8.544-.28 12.824-.384V11.8h11.98V.003H98.339V11.8h11.982v60.03h-.002zM12.295 79.772V34.897L27.471 77.96c4.667-.524 9.341-1.017 14.028-1.483V.001H29.201v46.483L12.825.001H0v81.384h.077c4.063-.562 8.14-1.096 12.218-1.613M85.98 11.797V.001H55.377V75.202a1100.584 1100.584 0 0 1 30.578-2.211V61.184c-5.916.344-11.82.74-17.71 1.181V43.497h15.397V31.706H68.245V11.797H85.98zM203.614 60.62V-.003h-12.873v71.876c10.24.376 20.44.9 30.606 1.56V61.619c-5.9-.381-11.81-.712-17.733-1"/></g></svg>

<a href="/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 81.387"><g fill="#b81d24"><path d="M256.09 76.212c4.178.405 8.354.84 12.52 1.29l9.198-22.712 8.743 24.807c4.486.562 8.97 1.152 13.44 1.768l-15.328-43.501L299.996 0H287.01l-.135.186-8.283 20.455L271.32.003h-12.822l13.237 37.565-15.644 38.644zM246.393 75.322V0h-12.817v74.265c4.275.33 8.552.684 12.817 1.056M150.113 71.11c3.46 0 6.916.026 10.366.054V43.492h15.397V31.708H160.48v-19.91h17.733V0h-30.6v71.12c.831 0 1.666-.013 2.5-.01M110.319 71.83c4.27-.152 8.544-.28 12.824-.384V11.8h11.98V.003H98.339V11.8h11.982v60.03h-.002zM12.295 79.772V34.897L27.471 77.96c4.667-.524 9.341-1.017 14.028-1.483V.001H29.201v46.483L12.825.001H0v81.384h.077c4.063-.562 8.14-1.096 12.218-1.613M85.98 11.797V.001H55.377V75.202a1100.584 1100.584 0 0 1 30.578-2.211V61.184c-5.916.344-11.82.74-17.71 1.181V43.497h15.397V31.706H68.245V11.797H85.98zM203.614 60.62V-.003h-12.873v71.876c10.24.376 20.44.9 30.606 1.56V61.619c-5.9-.381-11.81-.712-17.733-1"/></g></svg>
</a>
<?php
if(isset($_GET['ActionFree'])){

Expand Down Expand Up @@ -97,8 +103,8 @@
background: #f3f3f3;
position: absolute;
width: 34vw;
height: 40vw;
bottom: 0;
height: 35vw;
bottom: 7vw;
border-radius: 0.1vw;
}

Expand Down Expand Up @@ -295,7 +301,7 @@
<span style="float: left; position: absolute; top: 7.6vw; left: 2.6vw;">E-mail</span>
<input type="text" id="email" class="email-input"/>
<span style="float: left; position: absolute; top: 13.6vw; left: 2.6vw;">Senha</span>
<input type="text" id="senha" class="pass-input"/>
<input type="password" id="senha" class="pass-input"/>
<button class="free-btn" id="cadastrar" name="cadastrar">CRIAR CONTA FREE 1 MÊS</button>
<style>

Expand Down Expand Up @@ -346,12 +352,108 @@ function(data){
<div class="center">
<div class="card-login">
<p class="entrar">Entrar</p>

<Style>
.tens{
position: absolute;
top: 30vw;
left: 2vw;
}

.tens a{
color: red;
text-decoration: none;
}

.tens a:hover{
text-decoration: underline;
}

</style>

<p class="tens">Não tens uma conta, <a href="account.php?ActionFree=1">registre-se agora</a></p>

<center>
<div style="padding-top: 2vw;">
<form action="#" method="post">
<span style="float: left; position: absolute; top: 7.6vw; left: 2.6vw;">E-mail</span>
<input type="text" class="email-input"/>
<input type="text" class="email-input" name="lemail" id="lemail"/>
<span style="float: left; position: absolute; top: 13.6vw; left: 2.6vw;">Senha</span>
<input type="text" class="pass-input"/>
<input type="password" class="pass-input" name="lsenha" id="lsenha"/>
<button class="login-btn" id="login" name="cadastrar">Entrar</button>

<div id="resposta2">
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#login").click(function() {
var email2 = $("#lemail");
var emailPost2 = email2.val();
var senha2 = $("#lsenha");
var senhaPost2 = senha2.val();
$.post("login.php", {lemail: emailPost2, lsenha: senhaPost2},
function(data){
$("#resposta2").html(data);
}
, "html");
return false;
});
});
</script>

</form>

<style>
.login-btn{
display: inline-block;
text-decoration: none;
line-height: 1rem;
vertical-align: middle;
cursor: pointer;
font-weight: 700;
letter-spacing: .025rem;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-align: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: none;
position: relative;
min-height: 3.6vw;
top: 5vw;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.25);
-moz-box-shadow: 0 1px 1px rgba(0,0,0,.25);
box-shadow: 0 1px 1px rgba(0,0,0,.25);
color: #fff;
width: 30vw;
background: #e50914;
font-size: 1.5vw;
}
</style>

<style>
#resposta2{
width: 30vw;
color: red;
position: relative;
top: 6vw;
height: auto;
margin: 0px auto;
text-align: center;
border-radius: 0.3vw;
font-size: 1.5vw;
}
</style>



</div>
</center>
</div>
Expand Down
45 changes: 45 additions & 0 deletions configurando.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
require 'static/php/system/database.php';
require 'static/php/system/config.php';
$nome = $_POST['name'];

if (!($nome) ){
print "Preencha todos os campos!"; exit();
}
else{
//Abrindo Conexao com o banco de dados
$conexao = mysql_pconnect("localhost","root","") or die (mysql_error());
$banco = mysql_select_db("netflix");

//Utilizando o mysql_real_escape_string voce se protege o seu código contra SQL Injection.
$email5 = mysql_real_escape_string($email);
$senha = mysql_real_escape_string($senha);
$inisession = date('Y-m-d H:i:s');
$datec = date('Y-m-d H:i:s');
$lastlogin = date('Y-m-d H:i:s');
$configurado = '0';
$num1 = rand(15, 50);
$num2 = rand(121235321, 20);
$antispam5 = $num1 * $num2;
$antispam = DBEscape(strip_tags(trim(sha1($antispam5))));
$ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET character_set_client=utf8');
mysql_query('SET character_set_results=utf8');
$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$insert = mysql_query("insert into netflix_profiles (nome,datec,iduser) values ('{$nome}','{$datec}','{$iduser}')");
mysql_close($conexao);
if($insert) {
$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$userUP['configurado'] = 1;
if( DBUpdate( 'user', $userUP, "id = '{$iduser}'" ) ){
echo '';
}
print "Perfil criado com sucesso";
echo '<script>location.href="dashboard.php";</script>';
}else {
print "Ocorreu um erro!";
}
}
?>
161 changes: 161 additions & 0 deletions configure.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<?php
require 'static/php/system/database.php';
require 'static/php/system/config.php';
?>
<?php
if(isset($_COOKIE['iduser']) and (isset($_COOKIE['inisession']))){

$iduser2 = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$user2 = DBRead('user', "WHERE id = '{$iduser2}' LIMIT 1 ");
$user2 = $user2[0];


$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$user = DBRead('user', "WHERE id = '{$iduser}' LIMIT 1 ");
}
if(empty($_COOKIE['iduser']) and (empty($_COOKIE['inisession']))){
echo '<script>location.href="account.php";</script>';
}
if(empty($_COOKIE['inisession'])){
echo '<script>location.href="account.php";</script>';
}
if(empty($_COOKIE['iduser'])){
echo '<script>location.href="account.php";</script>';
}
if($user['configurado'] == 1){
echo '<script>location.href="dashboard.php";</script>';
}
?>

<head>
<title>
Netflix
</title>
<meta charset="UTF-8">
<link rel="shortcut icon" href="https://assets.nflxext.com/us/ffe/siteui/common/icons/nficon2016.ico"/>
</head>

<style>
*{
margin: 0;
padding: 0;
font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;
outline: none;
list-style:none;
}


.header-al-home-a svg{
height: 3vw;
margin-top: 1.1vw;
margin-left: 3vw;
opacity: .8;
cursor: pointer;
}

.header-al-home-a svg:hover{
opacity: 1;
}
</style>

<html>
<body style="background: #141414;">

<div class="header-al-home-a">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 81.387"><g fill="#b81d24"><path d="M256.09 76.212c4.178.405 8.354.84 12.52 1.29l9.198-22.712 8.743 24.807c4.486.562 8.97 1.152 13.44 1.768l-15.328-43.501L299.996 0H287.01l-.135.186-8.283 20.455L271.32.003h-12.822l13.237 37.565-15.644 38.644zM246.393 75.322V0h-12.817v74.265c4.275.33 8.552.684 12.817 1.056M150.113 71.11c3.46 0 6.916.026 10.366.054V43.492h15.397V31.708H160.48v-19.91h17.733V0h-30.6v71.12c.831 0 1.666-.013 2.5-.01M110.319 71.83c4.27-.152 8.544-.28 12.824-.384V11.8h11.98V.003H98.339V11.8h11.982v60.03h-.002zM12.295 79.772V34.897L27.471 77.96c4.667-.524 9.341-1.017 14.028-1.483V.001H29.201v46.483L12.825.001H0v81.384h.077c4.063-.562 8.14-1.096 12.218-1.613M85.98 11.797V.001H55.377V75.202a1100.584 1100.584 0 0 1 30.578-2.211V61.184c-5.916.344-11.82.74-17.71 1.181V43.497h15.397V31.706H68.245V11.797H85.98zM203.614 60.62V-.003h-12.873v71.876c10.24.376 20.44.9 30.606 1.56V61.619c-5.9-.381-11.81-.712-17.733-1"/></g></svg>
</div>

<style>
.config-perfil{
position: relative;
margin: 0px auto;
width: 30vw;
text-align: center;
color: #fff;
top: 3vw;
font-size: 1.2vw;
padding-top: 0.5vw;
}
.config-btn{
display: inline-block;
text-decoration: none;
line-height: 1rem;
vertical-align: middle;
cursor: pointer;
font-weight: 700;
letter-spacing: .025rem;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-align: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: none;
position: relative;
min-height: 3.6vw;
top: 2vw;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.25);
-moz-box-shadow: 0 1px 1px rgba(0,0,0,.25);
box-shadow: 0 1px 1px rgba(0,0,0,.25);
color: #fff;
width: 30vw;
background: #e50914;
font-size: 1.5vw;
}
</style>

<div class="config-perfil">

<h1>Configure seu perfil</h1>

<img src="/static/avatar/user1.png" style="width: 8vw; padding-top: 1vw;"/>

<form action="#" method="post">
<input type="text" name="name" id="name" placeholder="Nome de quem vai usar a conta" style="font-size: 1vw; border: none;width: 100%; padding: 0.5vw; border-radius: 0.1vw; position: relative; top: 0.5vw;"/>
<button class="config-btn" id="concluido">Concluido</button>
</form>

<div id="resposta">

</div>

<style>
#resposta{
width: 30vw;
color: red;
position: relative;
top: 6vw;
height: auto;
margin: 0px auto;
text-align: center;
border-radius: 0.3vw;
font-size: 1.5vw;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
$("#concluido").click(function() {
var name = $("#name");
var namePost = name.val();
$.post("configurando.php", {name: namePost},
function(data){
$("#resposta").html(data);
}
, "html");
return false;
});
});
</script>

</div>


</body>
</html>
Loading

0 comments on commit bea5ce6

Please sign in to comment.