Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include ('includes/config.php');
- include ('includes/functions.php');
- if (@ $_SESSION['auth']==1 ) {
- redirect("panel",100);
- }
- ?>
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html" />
- <meta name="Javad Pourmostafa" />
- <title>رمزنگار Version 1.0</title>
- <link href="style.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <?php if (!isset($_POST['usname']) && !isset($_POST['pasw'])) { ?>
- <div class="head">
- برای ورود به پنل مدیریت نام کاربری و رمز عبور را وارد کنید
- </div>
- <form action="" method="post" class="form">
- <p>
- <input name="usname" type="text" class="usp" size="0">
- </p>
- <p>
- <input name="pasw" type="password" class="usp" size="0">
- </p>
- <p>
- <input name="submit" type="submit" class="submit" value="ورود">
- </p>
- </form>
- <?php } //close if tag ?>
- <?php
- if (isset($_POST['usname']) && isset($_POST['pasw'])){
- $username = mysql_ramznegar($_POST['usname'],$link);
- $password = mysql_ramznegar($_POST['pasw'],$link);
- $query = "SELECT * FROM `admin` WHERE `usname` = $username";
- $admin_result = mysql_query($query,$link);
- $admin_result = mysql_fetch_array($admin_result,MYSQL_ASSOC);
- if($admin_result['usname']==$username && $admin_result['passw']==$password){
- if($admin_result[usname] == "admin"){
- $_SESSION['auth'] = 1;
- redirect("panel");
- exit;
- }
- else{
- echo 'نام کاربری یا پسورد شما اشتیاه م باشد';
- redirect("index.php");
- }
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement