- Katılım
- 27 Kasım 2007
- Mesajlar
- 0
- Reaction score
- 0
merhaba arkadaslar admine bir türlü giris yapamiyorum dosya sekillerini altda vericem sizlere acaba ne gibi bir yanislik var
tablosu
-----------------------
# Table structure for table `drinksadmin`
#
CREATE TABLE `drinksadmin` (
`username` varchar(20) NOT lisanssız default '0',
`password` varchar(20) default lisanssız,
PRIMARY KEY (`username`)
) TYPE=MyISAM;
#
# Dumping data for table `drinksadmin`
#
INSERT INTO `drinksadmin` (`username`, `password`) VALUES ('admin','admin');
# --------------------------------------------------------
connection.php
<?
$dbServer="localhost";
$dbuserName="root";
$dbpassword="sifre";
$dbName="root";
$con=mysql_connect ($dbServer, $dbuserName, $dbpassword) or die ('Cannot connect to the database.');
$db=mysql_select_db ($dbName);
session_start();
?>
login dosyasi
<?
include("connection.php");
$username=trim($username);
$password=trim($lpassword);
if($username=="" || $password =="")
{
header("Location: index.php?error=wu");
exit;
}
$sql="select password from drinksadmin where username='$username'";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
$dbpass=$row[0];
}
if($dbpass==$password)
{
session_start();
$admin_username=$username;
session_register("admin_username");
}
else
{
header("Location: index.php?error=wu");
exit;
}
?>
admin ana sayfa
<?
include("login.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<title>Control Panel</title>
<script language="JavaScript">
<!--
function checkifvalid(){
if (window.document.myform.username.value=="")
{
alert("Kindly enter your user name!");
window.document.myform.username.focus();
return false;
}
if (window.document.myform.lpassword.value=="")
{
alert("Kindly enter your password!");
window.document.myform.lpassword.focus();
return false;
}
return true;
}
</script>
</head>
<script language="JavaScript">
<?php
if(isset($error))
{
if($error=="wu")print("alert('Invalid Username and password!');");
if($error=="lo")print("alert('Your session has expired!');");
}
?>
</script>
</head>
tablosu
-----------------------
# Table structure for table `drinksadmin`
#
CREATE TABLE `drinksadmin` (
`username` varchar(20) NOT lisanssız default '0',
`password` varchar(20) default lisanssız,
PRIMARY KEY (`username`)
) TYPE=MyISAM;
#
# Dumping data for table `drinksadmin`
#
INSERT INTO `drinksadmin` (`username`, `password`) VALUES ('admin','admin');
# --------------------------------------------------------
connection.php
<?
$dbServer="localhost";
$dbuserName="root";
$dbpassword="sifre";
$dbName="root";
$con=mysql_connect ($dbServer, $dbuserName, $dbpassword) or die ('Cannot connect to the database.');
$db=mysql_select_db ($dbName);
session_start();
?>
login dosyasi
<?
include("connection.php");
$username=trim($username);
$password=trim($lpassword);
if($username=="" || $password =="")
{
header("Location: index.php?error=wu");
exit;
}
$sql="select password from drinksadmin where username='$username'";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
$dbpass=$row[0];
}
if($dbpass==$password)
{
session_start();
$admin_username=$username;
session_register("admin_username");
}
else
{
header("Location: index.php?error=wu");
exit;
}
?>
admin ana sayfa
<?
include("login.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<title>Control Panel</title>
<script language="JavaScript">
<!--
function checkifvalid(){
if (window.document.myform.username.value=="")
{
alert("Kindly enter your user name!");
window.document.myform.username.focus();
return false;
}
if (window.document.myform.lpassword.value=="")
{
alert("Kindly enter your password!");
window.document.myform.lpassword.focus();
return false;
}
return true;
}
</script>
</head>
<script language="JavaScript">
<?php
if(isset($error))
{
if($error=="wu")print("alert('Invalid Username and password!');");
if($error=="lo")print("alert('Your session has expired!');");
}
?>
</script>
</head>