It is currently March 24, 2019, 02:34:05 PM

Post new topic Reply to topic  [ 1 post ] 
 [PHP] Login system 
Author Message
User avatar

Joined: May 24, 2007, 10:01:08 AM
Posts: 46
Location: Brazil
Character: Adrena
Clan: Adepts of the Cult
Post [PHP] Login system
Don't use db so it's not safe...
Just to show how it works, don't screw all it up haha
PS: (it is in portuguese so if you don't understand something post here and i'll explain :))

PSĀ²: LOGIN = admin
Email =

First: Save as Login.php
<title>:: Login ::</title>

<body text="#000000" bgcolor="#C0C0C0">
   echo "Login or password is incorrect, Try again!";
<form method="POST" action="verify.php">
<div align="center">
<p align="center"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font size="5" face="Courier New">&nbsp;&nbsp; </font>
<font face="Verdana" color="#FF0000"><font size="2"><b>:: </b></font><b>
<font size="2">Administration ::</font></b></font></p>
<p align="center"> <b><font face="Courier New" size="4">&nbsp;&nbsp; Login: </font></b>
<input type="text" name="nome" size="20"></p><p align ="center">
<b><font size="4" face="Courier New">&nbsp; Email: </font></b>&nbsp;<input type="text" name="email" size="30"></p><p align ="center">
<input type="submit" value="ENVIAR" name="ENVIAR"></p><p align ="center">

<p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#0000FF">&nbsp; </font><b>
<font face="Verdana" size="1" color="#0000FF">By Adrena a.k.a Felipe, This login system is not safe. it's just to show how it works.!</font></b></p>

Second: Save as restrict.php

if(!IsSet($_SESSION["nome"]) || !IsSet($_SESSION["email"])){
   echo "RESTRICTED.";

<style type="text/css">
.style1 {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-weight: bold;
   font-size: 36px;
   color: #666666;
<body bgcolor="#C0C0C0">

<p align="center"><span class="style1"> <font color="#000000">Welcome NAME.</font></span></p>
<p align="center"><span class="style1"><font size="3">-&gt; Login System &lt;-</font></span></p>
<p align="center"><span class="style1">
<font face="Verdana" size="1" color="#FF0000">By Adrena a.k.a Felipe, This login system is not safe. it's just to show how it works.!</font></span></p>

Third: Save as verify.php


if(empty($nome) || strlen($nome)<5){
   echo "You got to write the name!";

if(empty($email) || strlen($email)<5 || strstr($email,"@")==FALSE){
   echo "You got to write the email!";


if (IsSet ($_COOKIE["pass"])){

if($nome=="admin" && $email==""){


header("Location: restrict.php");

   header("Location: login.php?erro=1");


Have fun! :puke:


December 27, 2007, 07:08:53 PM
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.