You last visited: Today at 11:50
Advertisement
[Release] Login-System mit MySql Datenbank
Discussion on [Release] Login-System mit MySql Datenbank within the AutoIt forum part of the Coders Den category.
06/28/2011, 03:22
#1
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
[Release] Login-System mit MySql Datenbank
Hallo e*pvper
ich habe mir aus langeweile mal ein kleines Login-System geschrieben, welches die Logindaten auf eine MySql Datenbank speichert.
Inhaltsverzeichniss:
1. Webspace
2. MySql Datenbank
3. Loginscript
4. Screenshot
1. Webspace:
Wie und wo man einen Webspace bekommen kann, sollte jeder wissen und möchste ich hier auch nicht erneut erklären.
Config.php
PHP Code:
<?PHP
//host loaction
define ( "_HOST" , "YOUR HOST" , TRUE );
//database username
define ( "_USER" , "DB-USERNAME" , TRUE );
//database username`s password
define ( "_PASS" , "DB-PASSWORT" , TRUE );
//database name
define ( "_DB" , "DB-NAME" , TRUE );
?>
Bei der Config.php ist zu beachten, alle daten wie z.B. den host und die Logindaten richtig auszufüllen!.
login.php
PHP Code:
<?php
// PHP-Code Beginn
@require( "config.php" );
$link = @ mysql_connect ( _HOST , _USER , _PASS );
@ mysql_select_db ( _DB );
$login = mysql_real_escape_string ( $_GET [ 'login' ]);
$passwort = mysql_real_escape_string ( $_GET [ 'pw' ]);
$result = mysql_query ( "SELECT * FROM user_data WHERE login = '" . $login . "' " );
$row = mysql_fetch_row ( $result );
if ( $row )
{
$DbPasswort = $row [ 2 ];
if ( $DbPasswort == $passwort )
{
echo " $row [ 3 ] " ;
}
else
{
echo 0 ;
}
}
else
{
echo 99 ;
}
?>
register.php
PHP Code:
<?php
// PHP-Code Beginn
@require( "config.php" );
$link = @ mysql_connect ( _HOST , _USER , _PASS );
@ mysql_select_db ( _DB );
$login = mysql_real_escape_string ( $_GET [ 'login' ]);
$passwort = mysql_real_escape_string ( $_GET [ 'pw' ]);
$email = mysql_real_escape_string ( $_GET [ 'email' ]);
$result1 = mysql_query ( "SELECT * FROM user_data WHERE login = '" . $login . "' " );
$row1 = mysql_fetch_row ( $result1 );
$result2 = mysql_query ( "SELECT * FROM user_data WHERE email = '" . $email . "' " );
$row2 = mysql_fetch_row ( $result2 );
if (! $login )
{
echo 99 ;
}
else
{
if ( $row1 )
{
echo 1 ;
}
elseif ( $row2 )
{
echo 2 ;
}
else
{
mysql_query ( "INSERT INTO user_data (`userid`,`login`,`password`,`email`) VALUES (NULL,' $login ', ' $passwort ', ' $email ')" );
echo 0 ;
}
}
?>
Update! recover.php:
PHP Code:
<?php
// PHP-Code Beginn
@require( "config.php" );
$link = @ mysql_connect ( _HOST , _USER , _PASS );
@ mysql_select_db ( _DB );
$login = mysql_real_escape_string ( $_GET [ 'login' ]);
$result = mysql_query ( "SELECT * FROM user_data WHERE login = '" . $login . "' " );
$row = mysql_fetch_row ( $result );
if ( $row )
{
$pool = "qwertzupasdfghkyxcvbnm" ;
$pool .= "23456789" ;
$pool .= "WERTZUPLKJHGFDSAYXCVBNM" ;
srand ((double) microtime ()* 1000000 );
for( $index = 0 ; $index < 5 ; $index ++)
{
$pass_word .= substr ( $pool ,( rand ()%( strlen ( $pool ))), 1 );
}
$absendername = "LoginSys" ;
$absendermail = " " ;
$betreff = "Password" ;
$text = "Hallo $login ,
dein neues Passwort lautet: $pass_word " ;
mail ( $row [ 3 ], $betreff , $text , "From: $absendername < $absendermail >" );
$newpw = md5 ( $pass_word );
mysql_query ( "UPDATE `user_data` SET `password`='" . $newpw . "' WHERE `login`='" . $login . "'" );
echo 1 ;
}
else
{
echo 0 ;
}
?>
Wichtig hierbei ist, das die config.php im selben ordner wie die login.php, register.php und recover.php sein muss.
2. MySql Datenbank:
Wie man eine MySql Datenbank erstellt usw. möchte ich ebenfalls nicht erklären, da es genug andere anleitungen gibt.
Wenn Sie eine Datenbank besitzen, einfach dieses Script ausführen:
PHP Code:
SET FOREIGN_KEY_CHECKS = 0 ;
-- ----------------------------
-- Table structure for ` user_data `
-- ----------------------------
DROP TABLE IF EXISTS ` user_data `;
CREATE TABLE ` user_data ` (
` userid ` int ( 11 ) NOT NULL AUTO_INCREMENT ,
` login ` varchar ( 255 ) DEFAULT NULL ,
` password ` varchar ( 255 ) DEFAULT NULL ,
` email ` varchar ( 255 ) DEFAULT NULL ,
PRIMARY KEY (` userid `)
) ENGINE = MyISAM AUTO_INCREMENT = 3 DEFAULT CHARSET = latin1 ;
-- ----------------------------
-- Records of user_data
-- ----------------------------
INSERT INTO ` user_data ` VALUES ( '1' , 'admin' , '21232f297a57a5a743894a0e4a801fc3' , ' ' );
INSERT INTO ` user_data ` VALUES ( '2' , 'member' , 'aa08769cdcb26674c6706093503ff0a3' , ' ' );
In dieser Tabelle befinden sich bereits 2 benutzer: admin und member.
Das Passwort ist gleich dem Loginnamen!
3. Loginscript:
So, nun kommt das LoginScript in autoit:
Login.au3:
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <MD5.au3>
$Form1 = GUICreate ( "LoginSystem | by Mozo" , 424 , 257 , 192 , 124 )
$Tab1 = GUICtrlCreateTab ( 16 , 16 , 393 , 225 )
GUICtrlSetResizing (- 1 , $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT )
$TabSheet1 = GUICtrlCreateTabItem ( "Login" )
$f_login = GUICtrlCreateInput ( "" , 160 , 80 , 217 , 21 )
$f_password = GUICtrlCreateInput ( "" , 160 , 128 , 217 , 21 , $ES_PASSWORD )
$l_login = GUICtrlCreateLabel ( "Loginname:" , 40 , 80 , 59 , 17 )
$l_password = GUICtrlCreateLabel ( "Password:" , 40 , 128 , 53 , 17 )
$b_login = GUICtrlCreateButton ( "Login" , 152 , 176 , 107 , 25 , $WS_GROUP )
$TabSheet2 = GUICtrlCreateTabItem ( "Register" )
GUICtrlSetState (- 1 , $GUI_SHOW )
$f_login_reg = GUICtrlCreateInput ( "" , 160 , 63 , 217 , 21 )
$f_password_reg = GUICtrlCreateInput ( "" , 160 , 105 , 217 , 21 , $ES_PASSWORD )
$f_password_wdh = GUICtrlCreateInput ( "" , 160 , 131 , 217 , 21 , $ES_PASSWORD )
$f_email = GUICtrlCreateInput ( "" , 160 , 174 , 217 , 21 )
$l_login_reg = GUICtrlCreateLabel ( "Loginname:" , 40 , 63 , 59 , 17 )
$l_password_reg = GUICtrlCreateLabel ( "Password:" , 40 , 105 , 53 , 17 )
$l_password_wdh = GUICtrlCreateLabel ( "Password wdh:" , 40 , 131 , 76 , 17 )
$l_email = GUICtrlCreateLabel ( "E-Mail:" , 40 , 174 , 36 , 17 )
$b_register = GUICtrlCreateButton ( "Register" , 152 , 208 , 107 , 25 , $WS_GROUP )
GUICtrlCreateTabItem ( "" )
GUISetState (@ SW_SHOW )
While 1
$nMsg = GUIGetMsg ()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $b_login
login ()
Case $b_register
register ()
EndSwitch
WEnd
Func login ()
$get = _INetGetSource ( "http://**************/login.php?login=" & GUICtrlRead ( $f_login )& "&pw=" & md5 ( GUICtrlRead ( $f_password )))
If $get = "0" Then
MsgBox ( 16 , "Passwort" , "Passwort falsch!" )
Return
ElseIf $get = "99" Then
MsgBox ( 16 , "Login" , "Benutzername falsch!" )
Return
Else
MsgBox ( 0 , "Login" , "Erfolgreich eingeloggt!" & @ CRLF & "Email: " & $get )
EndIf
EndFunc
Func register ()
If GUICtrlRead ( $f_login_reg ) <> "" Then
If GUICtrlRead ( $f_password_reg ) <> "" Then
If GUICtrlRead ( $f_password_reg ) <> GUICtrlRead ( $f_password_wdh ) Then
MsgBox ( 16 , "Register" , "Passwörter ungleich!" )
Return
Else
If GUICtrlRead ( $f_email ) <> "" Then
$regget = _INetGetSource ( "http://**************/register.php?login=" & GUICtrlRead ( $f_login_reg )& "&pw=" & md5 ( GUICtrlRead ( $f_password_wdh ))& "&email=" & GUICtrlRead ( $f_email ))
If $regget = "0" Then
MsgBox ( 0 , "Register" , "Registration abgeschlossen!" &@ CRLF & "Sie könne sich nun einloggen!" )
Return
ElseIf $regget = "1" Then
MsgBox ( 16 , "Register" , "Loginname ist bereits vergeben!" )
Return
ElseIf $regget = "2" Then
MsgBox ( 16 , "Register" , "E-Mail ist bereits vergeben!" )
Return
EndIf
Else
MsgBox ( 16 , "Register" , "Bitte eine E-Mail eingeben!" )
Return
EndIf
EndIf
Else
MsgBox ( 16 , "Register" , "Sie müssen ein Passwort eingeben!" )
EndIf
Else
MsgBox ( 16 , "Register" , "Sie müssen einen Loginnamen eingeben!" )
Return
EndIf
EndFunc
Update: login.au3 mit Password recovery :
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <MD5.au3>
$Form1 = GUICreate ( "LoginSystem | by Mozo" , 424 , 257 , 192 , 124 )
$Tab1 = GUICtrlCreateTab ( 16 , 16 , 393 , 225 )
GUICtrlSetResizing (- 1 , $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT )
$TabSheet1 = GUICtrlCreateTabItem ( "Login" )
$f_login = GUICtrlCreateInput ( "" , 160 , 80 , 217 , 21 )
$f_password = GUICtrlCreateInput ( "" , 160 , 128 , 217 , 21 , $ES_PASSWORD )
$l_login = GUICtrlCreateLabel ( "Loginname:" , 40 , 80 , 59 , 17 )
$l_password = GUICtrlCreateLabel ( "Password:" , 40 , 128 , 53 , 17 )
$b_login = GUICtrlCreateButton ( "Login" , 152 , 176 , 107 , 25 , $WS_GROUP )
$TabSheet2 = GUICtrlCreateTabItem ( "Register" )
GUICtrlSetState (- 1 , $GUI_SHOW )
$f_login_reg = GUICtrlCreateInput ( "" , 160 , 63 , 217 , 21 )
$f_password_reg = GUICtrlCreateInput ( "" , 160 , 105 , 217 , 21 , $ES_PASSWORD )
$f_password_wdh = GUICtrlCreateInput ( "" , 160 , 131 , 217 , 21 , $ES_PASSWORD )
$f_email = GUICtrlCreateInput ( "" , 160 , 174 , 217 , 21 )
$l_login_reg = GUICtrlCreateLabel ( "Loginname:" , 40 , 63 , 59 , 17 )
$l_password_reg = GUICtrlCreateLabel ( "Password:" , 40 , 105 , 53 , 17 )
$l_password_wdh = GUICtrlCreateLabel ( "Password wdh:" , 40 , 131 , 76 , 17 )
$l_email = GUICtrlCreateLabel ( "E-Mail:" , 40 , 174 , 36 , 17 )
$b_register = GUICtrlCreateButton ( "Register" , 152 , 208 , 107 , 25 , $WS_GROUP )
$TabSheet3 = GUICtrlCreateTabItem ( "Password recovery" )
GUICtrlSetState (- 1 , $GUI_SHOW )
$f_password_rec = GUICtrlCreateInput ( "" , 156 , 75 , 217 , 21 )
$l_password_rec = GUICtrlCreateLabel ( "Loginname:" , 36 , 75 , 59 , 17 )
$b_recover = GUICtrlCreateButton ( "Recover" , 112 , 136 , 163 , 25 , $WS_GROUP )
GUICtrlCreateTabItem ( "" )
GUISetState (@ SW_SHOW )
While 1
$nMsg = GUIGetMsg ()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $b_login
login ()
Case $b_register
register ()
Case $b_recover
recover ()
EndSwitch
WEnd
Func login ()
$get = _INetGetSource ( "http://mhwebmedia.eu/test/login.php?login=" & GUICtrlRead ( $f_login )& "&pw=" & md5 ( GUICtrlRead ( $f_password )))
If $get = "0" Then
MsgBox ( 16 , "Passwort" , "Passwort falsch!" )
Return
ElseIf $get = 99 Then
MsgBox ( 16 , "Login" , "Benutzername falsch!" )
Return
Else
MsgBox ( 0 , "Login" , "Erfolgreich eingeloggt!" & @ CRLF & "Email: " & $get )
EndIf
EndFunc
Func register ()
If GUICtrlRead ( $f_login_reg ) <> "" Then
If GUICtrlRead ( $f_password_reg ) <> "" Then
If GUICtrlRead ( $f_password_reg ) <> GUICtrlRead ( $f_password_wdh ) Then
MsgBox ( 16 , "Register" , "Passwörter ungleich!" )
Return
Else
If GUICtrlRead ( $f_email ) <> "" Then
$regget = _INetGetSource ( "http://mhwebmedia.eu/test/register.php?login=" & GUICtrlRead ( $f_login_reg )& "&pw=" & md5 ( GUICtrlRead ( $f_password_wdh ))& "&email=" & GUICtrlRead ( $f_email ))
If $regget = 0 Then
MsgBox ( 0 , "Register" , "Registration abgeschlossen!" &@ CRLF & "Sie könne sich nun einloggen!" )
Return
ElseIf $regget = 1 Then
MsgBox ( 16 , "Register" , "Loginname ist bereits vergeben!" )
Return
ElseIf $regget = 2 Then
MsgBox ( 16 , "Register" , "E-Mail ist bereits vergeben!" )
Return
EndIf
Else
MsgBox ( 16 , "Register" , "Bitte eine E-Mail eingeben!" )
Return
EndIf
EndIf
Else
MsgBox ( 16 , "Register" , "Sie müssen ein Passwort eingeben!" )
EndIf
Else
MsgBox ( 16 , "Register" , "Sie müssen einen Loginnamen eingeben!" )
Return
EndIf
EndFunc
Func recover ()
If GUICtrlRead ( $f_password_rec ) = "" Then
MsgBox ( 16 , "Recover" , "Sie müssen einen Loginnamen eingeben!" )
Else
$recget = _INetGetSource ( "http://mhwebmedia.eu/test/recover.php?login=" & GUICtrlRead ( $f_password_rec ))
If $recget = 1 Then
MsgBox ( 0 , "Recover" , "Passwort wurde resettet und per E-Mail verschickt!" )
ElseIf $recget = 0 Then
MsgBox ( 16 , "Recover" , "Loginname existiert nicht!" )
EndIf
EndIf
EndFunc
Ichtig hierbei ist, die adresse zu der login.php,
PHP Code:
$get = _INetGetSource ( "http://**************/login.php?login=" & GUICtrlRead ( $f_login )& "&pw=" & md5 ( GUICtrlRead ( $f_password )))
und die adresse zur register.php,
PHP Code:
$regget = _INetGetSource ( "http://**************/register.php?login=" & GUICtrlRead ( $f_login_reg )& "&pw=" & md5 ( GUICtrlRead ( $f_password_wdh ))& "&email=" & GUICtrlRead ( $f_email ))
anzupassen!
md5.au3:
PHP Code:
Func md5 ( $sMessage )
Local $Padding = Binary ( '0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' )
Local $bytes = Binary ( $sMessage ) + BinaryMid ( $Padding , 1 , BinaryLen ( $Padding ) - Mod ( BinaryLen ( $sMessage ), 64 )) + BinaryMid ( Binary ( BinaryLen ( $sMessage )* 8 )+ Binary ( 0 ), 1 , 8 )
Local $x [ BinaryLen ( $bytes )/ 4 ]
For $i = 1 To BinaryLen ( $bytes ) Step 4
$x [( $i - 1 )/ 4 ] = Dec ( StringTrimLeft ( Binary ( BinaryMid ( $bytes , $i + 3 , 1 ) + BinaryMid ( $bytes , $i + 2 , 1 ) + BinaryMid ( $bytes , $i + 1 , 1 ) + BinaryMid ( $bytes , $i , 1 )), 2 ))
Next
Local $a = 0x67452301 , $b = 0xEFCDAB89 , $c = 0x98BADCFE , $d = 0x10325476
For $k = 0 To UBound ( $x ) - 1 Step 16
$AA = $a
$BB = $b
$CC = $c
$DD = $d
; The hex number in the middle of each of the following lines
; an element from the 64 element table constructed with
; T ( i ) = Int ( 4294967296 * Abs ( Sin ( i ))) where i is 1 to 64.
;
; However , for speed we don 't want to calculate the value every time.
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $c), BitAND((BitNOT($b)), $d)) + $x[$k + 0x0],0) + 0xD76AA478,0),0), 0x07,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $b), BitAND((BitNOT($a)), $c)) + $x[$k + 0x1],0) + 0xE8C7B756,0),0), 0x0C,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $a), BitAND((BitNOT($d)), $b)) + $x[$k + 0x2],0) + 0x242070DB,0),0), 0x11,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $d), BitAND((BitNOT($c)), $a)) + $x[$k + 0x3],0) + 0xC1BDCEEE,0),0), 0x16,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $c), BitAND((BitNOT($b)), $d)) + $x[$k + 0x4],0) + 0xF57C0FAF,0),0), 0x07,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $b), BitAND((BitNOT($a)), $c)) + $x[$k + 0x5],0) + 0x4787C62A,0),0), 0x0C,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $a), BitAND((BitNOT($d)), $b)) + $x[$k + 0x6],0) + 0xA8304613,0),0), 0x11,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $d), BitAND((BitNOT($c)), $a)) + $x[$k + 0x7],0) + 0xFD469501,0),0), 0x16,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $c), BitAND((BitNOT($b)), $d)) + $x[$k + 0x8],0) + 0x698098D8,0),0), 0x07,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $b), BitAND((BitNOT($a)), $c)) + $x[$k + 0x9],0) + 0x8B44F7AF,0),0), 0x0C,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $a), BitAND((BitNOT($d)), $b)) + $x[$k + 0xA],0) + 0xFFFF5BB1,0),0), 0x11,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $d), BitAND((BitNOT($c)), $a)) + $x[$k + 0xB],0) + 0x895CD7BE,0),0), 0x16,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $c), BitAND((BitNOT($b)), $d)) + $x[$k + 0xC],0) + 0x6B901122,0),0), 0x07,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $b), BitAND((BitNOT($a)), $c)) + $x[$k + 0xD],0) + 0xFD987193,0),0), 0x0C,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $a), BitAND((BitNOT($d)), $b)) + $x[$k + 0xE],0) + 0xA679438E,0),0), 0x11,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $d), BitAND((BitNOT($c)), $a)) + $x[$k + 0xF],0) + 0x49B40821,0),0), 0x16,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $d), BitAND($c, (BitNOT($d)))) + $x[$k + 0x1],0) + 0xF61E2562,0),0),0x05,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $c), BitAND($b, (BitNOT($c)))) + $x[$k + 0x6],0) + 0xC040B340,0),0),0x09,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $b), BitAND($a, (BitNOT($b)))) + $x[$k + 0xB],0) + 0x265E5A51,0),0),0x0E,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $a), BitAND($d, (BitNOT($a)))) + $x[$k + 0x0],0) + 0xE9B6C7AA,0),0),0x14,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $d), BitAND($c, (BitNOT($d)))) + $x[$k + 0x5],0) + 0xD62F105D,0),0),0x05,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $c), BitAND($b, (BitNOT($c)))) + $x[$k + 0xA],0) + 0x02441453,0),0),0x09,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $b), BitAND($a, (BitNOT($b)))) + $x[$k + 0xF],0) + 0xD8A1E681,0),0),0x0E,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $a), BitAND($d, (BitNOT($a)))) + $x[$k + 0x4],0) + 0xE7D3FBC8,0),0),0x14,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $d), BitAND($c, (BitNOT($d)))) + $x[$k + 0x9],0) + 0x21E1CDE6,0),0),0x05,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $c), BitAND($b, (BitNOT($c)))) + $x[$k + 0xE],0) + 0xC33707D6,0),0),0x09,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $b), BitAND($a, (BitNOT($b)))) + $x[$k + 0x3],0) + 0xF4D50D87,0),0),0x0E,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $a), BitAND($d, (BitNOT($a)))) + $x[$k + 0x8],0) + 0x455A14ED,0),0),0x14,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitOR(BitAND($b, $d), BitAND($c, (BitNOT($d)))) + $x[$k + 0xD],0) + 0xA9E3E905,0),0),0x05,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitOR(BitAND($a, $c), BitAND($b, (BitNOT($c)))) + $x[$k + 0x2],0) + 0xFCEFA3F8,0),0),0x09,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitOR(BitAND($d, $b), BitAND($a, (BitNOT($b)))) + $x[$k + 0x7],0) + 0x676F02D9,0),0),0x0E,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitOR(BitAND($c, $a), BitAND($d, (BitNOT($a)))) + $x[$k + 0xC],0) + 0x8D2A4C8A,0),0),0x14,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($b, $c, $d) + $x[$k + 0x5],0) + 0xFFFA3942,0),0),0x04,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($a, $b, $c) + $x[$k + 0x8],0) + 0x8771F681,0),0),0x0B,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($d, $a, $b) + $x[$k + 0xB],0) + 0x6D9D6122,0),0),0x10,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($c, $d, $a) + $x[$k + 0xE],0) + 0xFDE5380C,0),0),0x17,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($b, $c, $d) + $x[$k + 0x1],0) + 0xA4BEEA44,0),0),0x04,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($a, $b, $c) + $x[$k + 0x4],0) + 0x4BDECFA9,0),0),0x0B,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($d, $a, $b) + $x[$k + 0x7],0) + 0xF6BB4B60,0),0),0x10,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($c, $d, $a) + $x[$k + 0xA],0) + 0xBEBFBC70,0),0),0x17,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($b, $c, $d) + $x[$k + 0xD],0) + 0x289B7EC6,0),0),0x04,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($a, $b, $c) + $x[$k + 0x0],0) + 0xEAA127FA,0),0),0x0B,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($d, $a, $b) + $x[$k + 0x3],0) + 0xD4EF3085,0),0),0x10,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($c, $d, $a) + $x[$k + 0x6],0) + 0x04881D05,0),0),0x17,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($b, $c, $d) + $x[$k + 0x9],0) + 0xD9D4D039,0),0),0x04,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($a, $b, $c) + $x[$k + 0xC],0) + 0xE6DB99E5,0),0),0x0B,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($d, $a, $b) + $x[$k + 0xF],0) + 0x1FA27CF8,0),0),0x10,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($c, $d, $a) + $x[$k + 0x2],0) + 0xC4AC5665,0),0),0x17,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($c, BitOR($b, (BitNOT($d)))) + $x[$k + 0x0],0) + 0xF4292244,0),0),0x06,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($b, BitOR($a, (BitNOT($c)))) + $x[$k + 0x7],0) + 0x432AFF97,0),0),0x0A,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($a, BitOR($d, (BitNOT($b)))) + $x[$k + 0xE],0) + 0xAB9423A7,0),0),0x0F,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($d, BitOR($c, (BitNOT($a)))) + $x[$k + 0x5],0) + 0xFC93A039,0),0),0x15,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($c, BitOR($b, (BitNOT($d)))) + $x[$k + 0xC],0) + 0x655B59C3,0),0),0x06,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($b, BitOR($a, (BitNOT($c)))) + $x[$k + 0x3],0) + 0x8F0CCC92,0),0),0x0A,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($a, BitOR($d, (BitNOT($b)))) + $x[$k + 0xA],0) + 0xFFEFF47D,0),0),0x0F,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($d, BitOR($c, (BitNOT($a)))) + $x[$k + 0x1],0) + 0x85845DD1,0),0),0x15,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($c, BitOR($b, (BitNOT($d)))) + $x[$k + 0x8],0) + 0x6FA87E4F,0),0),0x06,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($b, BitOR($a, (BitNOT($c)))) + $x[$k + 0xF],0) + 0xFE2CE6E0,0),0),0x0A,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($a, BitOR($d, (BitNOT($b)))) + $x[$k + 0x6],0) + 0xA3014314,0),0),0x0F,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($d, BitOR($c, (BitNOT($a)))) + $x[$k + 0xD],0) + 0x4E0811A1,0),0),0x15,"D")+$c,0)
$a = BitOR(BitRotate(BitOR($a + BitOR(BitOR(BitXOR($c, BitOR($b, (BitNOT($d)))) + $x[$k + 0x4],0) + 0xF7537E82,0),0),0x06,"D")+$b,0)
$d = BitOR(BitRotate(BitOR($d + BitOR(BitOR(BitXOR($b, BitOR($a, (BitNOT($c)))) + $x[$k + 0xB],0) + 0xBD3AF235,0),0),0x0A,"D")+$a,0)
$c = BitOR(BitRotate(BitOR($c + BitOR(BitOR(BitXOR($a, BitOR($d, (BitNOT($b)))) + $x[$k + 0x2],0) + 0x2AD7D2BB,0),0),0x0F,"D")+$d,0)
$b = BitOR(BitRotate(BitOR($b + BitOR(BitOR(BitXOR($d, BitOR($c, (BitNOT($a)))) + $x[$k + 0x9],0) + 0xEB86D391,0),0),0x15,"D")+$c,0)
$a = BitOR($a + $AA,0)
$b = BitOR($b + $BB,0)
$c = BitOR($c + $CC,0)
$d = BitOR($d + $DD,0)
Next
Return StringLower(StringMid(Hex($a),7,2) & StringMid(Hex($a),5,2) & StringMid(Hex($a),3,2) & StringMid(Hex($a),1,2) & _
StringMid(Hex($b),7,2) & StringMid(Hex($b),5,2) & StringMid(Hex($b),3,2) & StringMid(Hex($b),1,2) & _
StringMid(Hex($c),7,2) & StringMid(Hex($c),5,2) & StringMid(Hex($c),3,2) & StringMid(Hex($c),1,2) & _
StringMid(Hex($d),7,2) & StringMid(Hex($d),5,2) & StringMid(Hex($d),3,2) & StringMid(Hex($d),1,2))
EndFunc ;==>MD5
4. Screenshot:
Ich hoffe das Script hilft manchen leuten.
Mit freundlichen Grüßen
Mozo
06/28/2011, 14:17
#2
elite*gold: 0
Join Date: Dec 2008
Posts: 1,304
Received Thanks: 485
Sowas in der Art hat FreakBP zwar schon released, aber schöner Code + gut erklärt, ich verstehe es (aber ich kann PHP und AutoIt auch schon
)... bekommst ein thx für die Mühe
06/29/2011, 00:00
#3
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
Ich fande nur sein Sytem irgendwie sehr unsicher
Und da ich nach der arbeit immer tierische langeweile habe, hab ich mir gedacht ich bastel mir mal sowas :P
06/29/2011, 05:41
#4
elite*gold: 0
Join Date: Aug 2006
Posts: 409
Received Thanks: 150
Hab das mal ausprobiert weil ich mir das System mal anschauen wollte, doch wenn ich falsche Infos eingebe kommt immer
"Erfolgreich eingeloggt!
Email: 99"
obwohl $get=99 ist und somit eigentlich "Benutzername falsch" angezeigt werden müsste...
Das Gleiche passiert auch bei falschem Passwort. Irgendeine Idee wie das zu lösen ist?
//edit: Ok, hab die Lösung gefunden: Ich habe aus "If $get = "0" Then" einfach "If $get = 0 Then " gemacht und bei "If $get = "99" Then" "If $get = 99 Then".
Klappt nun wunderbar.
06/29/2011, 14:15
#5
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
Hab das Script recht schnell geschrieben :P
Naja werde heute abend nochmal eine erweiterung Posten
06/29/2011, 21:12
#6
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
Man kann doch auch das Passwort erst in dem php script hashen lassen.
06/30/2011, 02:38
#7
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
Soo hab mal ein kleines update gebastelt :P
Passwort recovery: Falls man sein passwort vergessen haben sollte, kann man sich nun einfach ein neues passwort per email zusenden lassen
Nächstes Update beinhaltet geheimfrage und antwort + passwort ändern
Falls noch jemand vorschläge oder sonstiges hat, kann er diese gerne hier posten
06/30/2011, 02:42
#8
elite*gold: 0
Join Date: Oct 2009
Posts: 300
Received Thanks: 24
nice
06/30/2011, 14:03
#9
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
Heute abend kommt noch Passwort Change ..
Erstmal ohne geheimfrage + antwort :P
07/01/2011, 00:47
#10
elite*gold: 0
Join Date: Jun 2011
Posts: 67
Received Thanks: 4
Nen link zum TuTorial für MySQL
Und vielleicht könntest du es mehr auskommentieren für Anfänger halt.
Sonst ist es echt gut geworden bekommst nen Thx.
Ne Ip mit Logung und nen Programm Update könnte es noch beinhalten dann wäre es Perfekt für mich :-) .
07/01/2011, 13:32
#11
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
Ich werde heute abend mal ein größeres update releasen.
@Vierus.exe
IP-Logging und Update wäre auch möglich
Wie sollte deiner meinung nach die IP's geloggt werden? :P
07/01/2011, 18:02
#12
elite*gold: 0
Join Date: Dec 2008
Posts: 1,304
Received Thanks: 485
PHP hat eine Funktion, um die IP heraus zu finden... diese einfach mit dem Login-Name in einer .txt-Datei speichern, par example
07/01/2011, 18:36
#13
elite*gold: 0
Join Date: Jun 2011
Posts: 67
Received Thanks: 4
@Mozo
Auf dem Server sollten die Namen + Ip + RegistrierungPW in einer geschützten und Verschlüsselten Datei gespeichert werden die nur der Programmierer dann auch Auslesen kann. ;-)
07/02/2011, 14:22
#14
elite*gold: 0
Join Date: Sep 2008
Posts: 526
Received Thanks: 82
Sorry, update verschiebt sich durch private aktivitäten auf spätestens sonntag :P
07/02/2011, 19:39
#15
elite*gold: 0
Join Date: Jun 2011
Posts: 67
Received Thanks: 4
Bin verwirrt wo müssen die config.php und so weiter hin auf den Webserver oder?
was ist das alles
Sind das die Befehle?
MfG
Vierus
Similar Threads
[Release] Fastest MySql System [C#]
04/18/2011 - CO2 PServer Guides & Releases - 51 Replies
Removed.
Why do you think?
Is it really THAT shocking to you that I removed it?
Mysql Login System erstellen
04/04/2011 - Web Development - 9 Replies
Hallo zusammen =)
ich mal wieder xD
da mein anderes problem mit dem Kontaktformular noch in Arbeit ist, komme ich schon einmal zu meinem nächsten Problem
ich habe ,nach dem Tutorial von Hier
Eine Datenbank erstellt und bin schon bei Punkt 2 und genau da tritt mein problem auf....
[Release]Datenbank Login per Php-Scirpt
12/25/2010 - Coding Releases - 2 Replies
Hey epvp coder,
2008 !
Ich möchte euch mal mein kleines Online Programm Vorstellen. Ich weiß es ist nicht sehr schwer zu Erstellen , aber naja mir war langweilig und ich wollte es einfach mal zeigen :D
Also:
1. Das Programm schaut zuerst ob man noch Eingeloggt ist , wenn man eingeloggt ist kommt man bei mir (Zum Fourm) , wenn nicht kommt halt
der Login.
[Release] MySQL Insert system
07/18/2010 - CO2 PServer Guides & Releases - 18 Replies
Ello!
First of all, this is NOT sourcedependent, which means you can use this on any source without modifying the code.
This is an replacement for all of you who still uses normal MySQL queries. Use this code to clean up, make it easier and more orginazed.
Here's how it looks:
Example: (Original (LOTF for example))
All times are GMT +2. The time now is 11:50 .