-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3b01253
Showing
6 changed files
with
290 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
if(!mysql_connect("localhost","root","Ladiesman41&")) | ||
{ | ||
die('oops connection problem ! --> '.mysql_error()); | ||
} | ||
if(!mysql_select_db("dbtest")) | ||
{ | ||
die('oops database selection problem ! --> '.mysql_error()); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
session_start(); | ||
include_once 'dbconnect.php'; | ||
|
||
if(!isset($_SESSION['user'])) | ||
{ | ||
header("Location: index.php"); | ||
} | ||
$res=mysql_query("SELECT * FROM users WHERE user_id=".$_SESSION['user']); | ||
$userRow=mysql_fetch_array($res); | ||
?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>Welcome - <?php echo $userRow['email']; ?></title> | ||
<link rel="stylesheet" href="style.css" type="text/css" /> | ||
</head> | ||
<body> | ||
<div id="header"> | ||
<div id="left"> | ||
<label>cleartuts</label> | ||
</div> | ||
<div id="right"> | ||
<div id="content"> | ||
hi' <?php echo $userRow['username']; ?> <a href="logout.php?logout">Sign Out</a> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
session_start(); | ||
include_once 'dbconnect.php'; | ||
|
||
if(isset($_SESSION['user'])!="") | ||
{ | ||
header("Location: home.php"); | ||
} | ||
if(isset($_POST['btn-login'])) | ||
{ | ||
$email = mysql_real_escape_string($_POST['email']); | ||
$upass = mysql_real_escape_string($_POST['pass']); | ||
$res=mysql_query("SELECT * FROM users WHERE email='$email'"); | ||
$row=mysql_fetch_array($res); | ||
if($row['password']==md5($upass)) | ||
{ | ||
$_SESSION['user'] = $row['user_id']; | ||
header("Location:home.php"); | ||
} | ||
else | ||
{ | ||
?> | ||
<script>alert('wrong details');</script> | ||
<?php | ||
} | ||
|
||
} | ||
?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>cleartuts - Login & Registration System</title> | ||
<link rel="stylesheet" href="style.css" type="text/css" /> | ||
</head> | ||
<body> | ||
<center> | ||
<div id="login-form"> | ||
<form method="post"> | ||
<table align="center" width="30%" border="0"> | ||
<tr> | ||
<td><input type="text" name="email" placeholder="Your Email" required /></td> | ||
</tr> | ||
<tr> | ||
<td><input type="password" name="pass" placeholder="Your Password" required /></td> | ||
</tr> | ||
<tr> | ||
<td><button type="submit" name="btn-login">Sign In</button></td> | ||
</tr> | ||
<tr> | ||
<td><a href="register.php">Sign Up Here</a></td> | ||
</tr> | ||
</table> | ||
</form> | ||
</div> | ||
</center> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
session_start(); | ||
|
||
if(!isset($_SESSION['user'])) | ||
{ | ||
header("Location: index.php"); | ||
} | ||
else if(isset($_SESSION['user'])!="") | ||
{ | ||
header("Location: home.php"); | ||
} | ||
|
||
if(isset($_GET['logout'])) | ||
{ | ||
session_destroy(); | ||
unset($_SESSION['user']); | ||
header("Location: index.php"); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
session_start(); | ||
if(isset($_SESSION['user'])!="") | ||
{ | ||
header("Location: home.php"); | ||
} | ||
include_once 'dbconnect.php'; | ||
|
||
if(isset($_POST['btn-signup'])) | ||
{ | ||
$uname = mysql_real_escape_string($_POST['uname']); | ||
$email = mysql_real_escape_string($_POST['email']); | ||
$upass = md5(mysql_real_escape_string($_POST['pass'])); | ||
|
||
if(mysql_query("INSERT INTO users(username,email,password) VALUES('$uname','$email','$upass')")) | ||
{ | ||
?> | ||
<script>alert('successfully registered ');</script> | ||
<?php | ||
} | ||
else | ||
{ | ||
?> | ||
<script>alert('error while registering you...');</script> | ||
<?php | ||
} | ||
} | ||
?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>Login & Registration System</title> | ||
<link rel="stylesheet" href="style.css" type="text/css" /> | ||
|
||
</head> | ||
<body> | ||
<center> | ||
<div id="login-form"> | ||
<form method="post"> | ||
<table align="center" width="30%" border="0"> | ||
<tr> | ||
<td><input type="text" name="uname" placeholder="User Name" required /></td> | ||
</tr> | ||
<tr> | ||
<td><input type="email" name="email" placeholder="Your Email" required /></td> | ||
</tr> | ||
<tr> | ||
<td><input type="password" name="pass" placeholder="Your Password" required /></td> | ||
</tr> | ||
<tr> | ||
<td><button type="submit" name="btn-signup">Sign Me Up</button></td> | ||
</tr> | ||
<tr> | ||
<td><a href="index.php">Sign In Here</a></td> | ||
</tr> | ||
</table> | ||
</form> | ||
</div> | ||
</center> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
@charset "utf-8"; | ||
/* CSS Document */ | ||
|
||
* | ||
{ | ||
margin:0; | ||
padding:0; | ||
} | ||
#login-form | ||
{ | ||
margin-top:70px; | ||
} | ||
table | ||
{ | ||
border:solid #dcdcdc 1px; | ||
padding:25px; | ||
box-shadow: 0px 0px 1px rgba(0,0,0,0.2); | ||
} | ||
table tr,td | ||
{ | ||
padding:15px; | ||
//border:solid #e1e1e1 1px; | ||
} | ||
table tr td input | ||
{ | ||
width:97%; | ||
height:45px; | ||
border:solid #e1e1e1 1px; | ||
border-radius:3px; | ||
padding-left:10px; | ||
font-family:Verdana, Geneva, sans-serif; | ||
font-size:16px; | ||
background:#f9f9f9; | ||
transition-duration:0.5s; | ||
box-shadow: inset 0px 0px 1px rgba(0,0,0,0.4); | ||
} | ||
|
||
table tr td button | ||
{ | ||
width:100%; | ||
height:45px; | ||
border:0px; | ||
background:#db8d00; | ||
background:-moz-linear-gradient(top, #595959 , #515151); | ||
border-radius:3px; | ||
box-shadow: 1px 1px 1px rgba(1,0,0,0.2); | ||
color:#f9f9f9; | ||
font-family:Verdana, Geneva, sans-serif; | ||
font-size:18px; | ||
font-weight:bolder; | ||
text-transform:uppercase; | ||
} | ||
table tr td button:active | ||
{ | ||
position:relative; | ||
top:1px; | ||
} | ||
table tr td a | ||
{ | ||
text-decoration:none; | ||
color:#00a2d1; | ||
font-family:Verdana, Geneva, sans-serif; | ||
font-size:18px; | ||
} | ||
|
||
/* css for home page */ | ||
|
||
* | ||
{ | ||
margin:0; | ||
padding:0; | ||
} | ||
#header | ||
{ | ||
width:100%; | ||
height:60px; | ||
background:rgba(00,11,22,33); | ||
color:#9fa8b0; | ||
font-family:Verdana, Geneva, sans-serif; | ||
} | ||
#header #left | ||
{ | ||
float:left; | ||
position:relative; | ||
} | ||
#header #left label | ||
{ | ||
position:relative; | ||
top:5px; | ||
left:100px; | ||
font-size:35px; | ||
} | ||
#header #right | ||
{ | ||
float:right; | ||
position:relative; | ||
} | ||
#header #right #content | ||
{ | ||
position:relative; | ||
top:20px; | ||
right:100px; | ||
color:#fff; | ||
} | ||
#header #right #content a | ||
{ | ||
color:#00a2d1; | ||
} | ||
|
||
/* css for home page */ |