<? ob_start(); ?>
<!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" />

<link href="css/index.css" rel="stylesheet" type="text/css" />


</head>

<body>
<!-- outer -->
<div id="outerall">
	<div class="webname">Egas C.Panel</div>
    <form action="<?= $_SERVER['PHP_SELF']; ?>" method="post">
    <div class="inputall">
    <div class="in_name"><input class="inbut" type="password" name="password_f" size="20" onblur="if(this.value=='') this.value='PassWord';" onfocus="if(this.value=='PassWord') this.value='';" value="PassWord" /></div>
    <div class="in_name2"><input class="inbut" type="text" name="username_f" size="20" onblur="if(this.value=='') this.value='UserName';" onfocus="if(this.value=='UserName') this.value='';" value="UserName" /></div>
    </div>
    <!--<a href="forgetpass.php"><div class="forget">for get pass</div></a>-->
    <div class="logina"><input class="submit" type="submit" name="submit_f" value="LogIn" /></div>
    </form>
    <?php
                                if($_POST['submit_f']){                     
                                $user_f = strip_tags($_POST['username_f']);
                                $password_f = md5(strip_tags($_POST['password_f']));
                                $Error = "Sory : ";
                                $Full = "Thank You : ";
                                //echo "test 123456789 alo alo taa taa";
                                //header("location: login.php");
                                    //valedation user & pass    
                                    if($user_f == "" && $password_f == ""){
                                        
                                        $Error .= "هذا المستخدم غير متوفر";
                                        echo "<font color='red'>$Error</font>";
                                    
                                    //valedation user
                                    }elseif($user_f == ""){
                                        
                                        $Error .= "هذا المستخدم غير متوفر";
                                        echo "<font color='red'>$Error</font>";
                                        
                                    //valedation pass
                                    }elseif($password_f == ""){
                                        
                                        $Error .= "هذا المستخدم غير متوفر";
                                        echo "<font color='red'>$Error</font>";
                                        
                                    //connection db    
                                    }else{
                                       require_once("../lib/func_ar.php");
                                       $sel = "select * from users";
                                       $query=mysql_query($sel);
                                       while($rows=mysql_fetch_assoc($query)){
                                            extract($rows);
                                            //valedation user & pass in db
                                            if($user_f !== $user && $password_f !== $pass){
                                                
                                                //echo "test 123456789 alo alo taa taa";
                                               $Error .= "هذا المستخدم غير متوفر";
                                                echo "<font color='red'>$Error</font>";
                                                
                                            //valedation user db
                                            }elseif($user_f !== $user){
                                                
                                                //echo "test 123456789 alo alo taa taa";
                                                $Error .= "هذا المستخدم غير متوفر";
                                                echo "<font color='red'>$Error</font>";
                                                
                                            //valedation pass db
                                            }elseif($password_f !== $pass){
                                                
                                                //echo "test 123456789 alo alo taa taa";
                                                $Error .= "هذا المستخدم غير متوفر";
                                                echo "<font color='red'>$Error</font>";
                                                
                                            //good and location here
                                            
                                            }else {
                                                //set cookies
                                                require_once("functions.php");
                                                $name=$admin;
                                                $value="hossam";
                                                $expr=time()+60*60*10;
                                                setcookie($name,$value,$expr);
                                                header('Location: info.php');
                                            }
                                       }
                                            
                                    }
                                                            
                                }
                   
                                       
                            ?>
    
</div>
<!-- outer -->
<div class="copyright">All coyright&copy; <a>Mideastnet.COM</a></div>
</body>
</html>
<?php ob_flush(); ?>