Added files via upload
Esse commit está contido em:
+14
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="js/funcoes.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<p id="demo">Let AJAX change this text.</p>
|
||||
|
||||
<button type="button" onclick="ajax('demo', 'cadastrar.php')">Change Content</button>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
include("conexao.php");
|
||||
session_start();
|
||||
|
||||
if(isset($_POST["submit"])){
|
||||
$SESSION["usuario"] = $usuario=$_POST["usuario_txt"];
|
||||
$SESSION["email"] = $email=$_POST["email_txt"];
|
||||
$SESSION["senha"] = $senha=crypt($_POST["senha_txt"]);
|
||||
$query = "SELECT * FROM sisto_usuarios WHERE usuario='$usario' OR email='$email'";
|
||||
$query = mysql_query($query) or die(mysql_error());
|
||||
$cont= mysql_num_rows($query);
|
||||
|
||||
if($cont>0){
|
||||
echo "já cadastrado";
|
||||
}else{
|
||||
$query = mysql_query("INSERT INTO sisto_usuarios (usuario, email, senha) VALUES ('$usuario', '$email', '$senha')") or die (mysql_error());
|
||||
if($query)
|
||||
header("location: index.php ");
|
||||
else {
|
||||
echo "Erro no servidor. Não cadastrou. Tente novamente.";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Sisto</title>
|
||||
</head>
|
||||
<body>
|
||||
<form action="" method="POST" class="login">
|
||||
<div class="formulario_login">
|
||||
<span label="usuario">Usuário: </span>
|
||||
<span label="usuario_txt"><input type="text" name="usuario_txt" /></span>
|
||||
<span label="email">Email: </span>
|
||||
<span label="email_txt"><input type="text" name="email_txt" /></span>
|
||||
<span label="senha">Senha: </span>
|
||||
<span label="senha_txt"><input type="password" name="senha_txt" /></span>
|
||||
<span label="senha_txt"><input type="submit" name="submit" /></span>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
|
||||
//MySQL
|
||||
mysql_connect("localhost", "root", "123");
|
||||
mysql_select_db("sisto");
|
||||
|
||||
//PostgreSQL
|
||||
//pg_connect("host=localhost port=5432 dbname=sisto user=postgres password=123");
|
||||
@@ -0,0 +1,3 @@
|
||||
.erro{
|
||||
color:red;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
include("sessao.php");
|
||||
|
||||
?>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
include("conexao.php");
|
||||
session_start();
|
||||
|
||||
if(isset($_POST["submit"])){
|
||||
$usuario = $_POST["usuario_txt"];
|
||||
$senha = $_POST["senha_txt"];
|
||||
$query = "SELECT * FROM sisto_usuarios WHERE (usuario='$usuario' OR email='$usuario')";
|
||||
$query = mysql_query($query) or die(mysql_error());
|
||||
$mostra = mysql_fetch_array($query);
|
||||
$decrypt = crypt($senha, $mostra["senha"]);
|
||||
|
||||
if($mostra["senha"]==$decrypt){
|
||||
$_SESSION["id"]=$mostra["id"];
|
||||
header("location:index.php");
|
||||
}else{
|
||||
echo "<span class='erro'>O e-mail ou o usuário inserido não corresponde a nenhuma conta. Cadastre-se para abrir uma conta.</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Sisto</title>
|
||||
<link rel="stylesheet" href="estilo.css" />
|
||||
</head>
|
||||
<body>
|
||||
<form action="" method="POST" class="login">
|
||||
<div class="formulario_login">
|
||||
<span label="usuario">Usuário ou Email: </span>
|
||||
<span label="usuario_txt"><input type="text" name="usuario_txt" /></span>
|
||||
<span label="senha">Senha: </span>
|
||||
<span label="senha_txt"><input type="password" name="senha_txt" /></span>
|
||||
<span label="senha_txt"><input type="submit" name="submit" /></span>
|
||||
</div>
|
||||
<span label="recuperar_lnk"><a href="">Recuperar senha</a></span>
|
||||
<span label="cadastrar_lnk"><a href="cadastrar.php">Cadastre-se</a></span>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
if(empty($_SESSION["id"])){
|
||||
header("location:login.php");
|
||||
}else{
|
||||
header("location:index.php");
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
Arquivo binário não exibido.
@@ -0,0 +1,8 @@
|
||||
#include<stdio.h>
|
||||
|
||||
int main(){
|
||||
|
||||
printf("teste");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Referência em uma Nova Issue
Bloquear um usuário