Skip to content

Instantly share code, notes, and snippets.

View gabcarvalhogama's full-sized avatar

Gabriel Carvalho Gama gabcarvalhogama

View GitHub Profile
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<title>..:: Maclife ::..</title>
<style id="jsbin-css">
*{
margin: 0;
padding: 0;
@gabcarvalhogama
gabcarvalhogama / painel.php
Created July 10, 2015 11:36
Como criar um sistema de login em PHP
<?php
/*Antes de Tudo, tudo mesmo, testamos se uma das sessões que iniciamos na index não existem*/
session_start();
if(!isset($_SESSION["usuario"]) || !isset($_SESSION["senha"])){
header("Location: index.php");
exit;
}
/* Caso as duas sessões existam,
*criamos duas variaveis que vai obter o nome de usuario
*e senha que estão guardados na sessão para posteriormente usa-los.*/
@gabcarvalhogama
gabcarvalhogama / logout.php
Created July 10, 2015 11:40
Como criar um sistema de login em PHP
<?php
/* Destruimos a sessão e redirecionamos
o usuário para a página index.php */
session_start();
session_destroy();
header("Location: index.php")
?>
@gabcarvalhogama
gabcarvalhogama / index.php
Last active January 15, 2025 19:56
Como criar um sistema de Login em PHP(Sem MySQL)
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Sistema de Login :: Toolmmer</title>
<meta charset="UTF-8" />
<!-- Estilos da Index.php -->
<style type="text/css">
body{
background: linear-gradient(45deg, #f0f9ff 10%, #cbebff 47%, #a1dbff 100%);
}
@gabcarvalhogama
gabcarvalhogama / sistema_de_login.sql
Created August 1, 2015 18:30
Banco de Dados e Tabela do Sistema de Login
CREATE DATABASE `sistema_de_login`;
CREATE TABLE IF NOT EXISTS `sistema_de_login`.`tb_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(20) NOT NULL,
`pass` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
@gabcarvalhogama
gabcarvalhogama / logout.php
Created August 1, 2015 18:47
Logout.php :: Como criar um Sistema de Login em PHP e MySQL(PDO)
<?php
/* Destruimos a sessão e redirecionamos
o usuário para a página index.php */
session_start();
session_destroy();
header("Location: index.php")
?>
@gabcarvalhogama
gabcarvalhogama / style.css
Last active August 27, 2015 16:55
Como mudar a cor do placeholder – HTML & CSS :: Scriptadores
::-webkit-input-placeholder { /* WebKit browsers */
color: red;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: red;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: red;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
@gabcarvalhogama
gabcarvalhogama / index.php
Created August 31, 2015 16:08
Index.php :: Validação de E-Mail - PHP
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<title>Validação de E-mail - PHP :: Scriptadores</title>
<!-- Alguns estilos em CSS para ficar bunitinhu :v -->
<style type="text/css">
body{background: linear-gradient(45deg, rgba(0, 150, 0,.8) 10%, #fff 47%, rgba(0, 150, 0,.8) 100%);}
div.global{
width: 40%;
@gabcarvalhogama
gabcarvalhogama / index.html
Created November 27, 2015 21:33
Como definir uma favicon
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
@gabcarvalhogama
gabcarvalhogama / index.php
Last active January 3, 2016 02:39
Como criar um sistema de upload de imagens em PHP
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Como criar um sistema de upload de imagens em PHP</title>
</head>
<body>
<form method="post" name="formUpload" action="upload.php" enctype="multipart/form-data">
<input type="file" name="file[]" multiple />
<input type="submit" value="Upar" />
</form>