Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
<?php
2
//Dc-shout2.0 (c)devilcoderz 2004
3
 
4
include "header.php";
5
include "config.php";
6
include "functions.php";
7
if ($dc=="")
8
{
9
if (!session_is_registered(username)) {
10
echo"
11
<form method=\"POST\" action=\"index.php?dc=login\">
12
<center>Username :<input type=\"text\" NAME=\"username\" size=\"20\"><br>
13
Password :<input type=\"text\" NAME=\"password\" size=\"20\"><br>
14
<input type=\"submit\" value=\"Log In\" Name=\"submit\">
15
</form>
16
</center>";
17
}
18
else 
19
{
20
echo "welcome back to Dc shout admin panel";
21
}
22
}
23
if ($dc=="login")
24
{
25
if (!$_POST['username'] | !$_POST['password'] )
26
{
27
die('You did not fill in a username or password.<u><a href=javascript:%20history.back(-2)>Back</a></u>.') ;
28
}
29
$user = $username ;
30
$pass = md5 ($_POST['password']) ;
31
$result=mysql_query("select * from dc_admin where user='$user' ") or die ("No such username");
32
while ($row=mysql_fetch_array($result)) {
33
if ($row["password"]==$pass) {
34
echo ("You are now logged in $user!");
35
$_SESSION["username"] = "$user"; 
36
$_SESSION["password"] = "$pass"; 
37
}
38
else
39
{
40
echo"no such password";
41
}
42
}
43
}
44
if ($dc=="logout")
45
{
46
logout() ;
47
}
48
include "footer.php";
49
?>
50
 
51
 
52
 
53
 
54
 
55
 
56
 
57
 
58
 
59