אשכול: בעיה ב-md5
View Single Post
ישן 17-06-09, 14:19   # 6
Jonathan Zeierman
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Jun 2007
הודעות: 1,003

Jonathan Zeierman לא מחובר  

אתה מתכוון למשהו כזה?
PHP קוד:
    if (isset($_POST["send"])) 
    { 
        
////////////////////////////////////////////////////////////////// 
        // If user & pass are right, create session and login. /////////// 
        ////////////////////////////////////////////////////////////////// 
            
$user $_POST["user"]; 
            
$pass md5($_POST["pass"]); 
             
            
$query "SELECT * FROM users WHERE user = '{$user}' AND password = '{$pass}'"
            
$result mysql_query($query
            or die(
"SQL Getting The Next Error:" mysql_error()); 
             
                if(
mysql_fetch_rows($query) > 0)
                {
                     
                    
$_SESSION["user"] = $user
                    
$_SESSION["pass"] = $pass
                    
header("Location: manage.php?act=Admin"); 
                } 
             
                    
/////////////////////////////////////////////////////////////////// 
                    // If user & pass worng, show us an erroe msseage.  /////////////// 
                    /////////////////////////////////////////////////////////////////// 
                    
if ($row["user"] != $user && $row["password"] != $pass
                    { 
                        echo 
'<html dir="rtl"> 
                        <head> 
                        <link rel="stylesheet" type="text/css" href="includes/css/style.css" media="screen"/> 
                        <meta http-equiv="Content-Language" content="he"> 
                        <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> 
                        <title>שגיאה</title> 
                        </head> 
                        <body> 
                        <center> 
                        <div class="error" style="width:350px" align="right"> 
                        <table cellpadding="6" cellspacing="2" width="100%"> 
                        <tr> 
                        <td> 
                        <img src="images/error.gif" /> <b>שגיאה:</b> שם משתמש ו/או סיסמה שגויים.</td> 
                        </tr> 
                        </table> 
                        </div><div class="space"></div> 
                        </center> 
                        </body> 
                        </html>'

                    }
    } 
__________________
יונתן.
אימייל: jonathan@zeierman.net
  Reply With Quote