Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*//pseudocod
- if (!isset $_COOKIE[sesiune])
- {
- $random name
- $random password
- create random user ($random name, $random password)
- setcookie(sesiune, md5($row[id]./random(10))
- update db write md5
- }
- //logarea automata
- query = select * from users where md5 = $_COOKIE[sesiune] LIMIT 1
- while(row mysqlfetchasoc)
- {
- $_SESSION[id] =
- $_SESSION[level] =
- }
- LOGIN FORM
- {
- input user, input pass
- query = select * from users where user=user and pass=pass LIMIT 1
- if(mysqlnumrows = 1)
- {
- if (row[md5] == $_COOKIE[sesiune])
- {
- session_start()
- $newmd5 = md5($row[id]./random(10))
- setcookie(sesiune, md5($row[id]./random(10))
- update db write md5
- $_SESSION[id] =
- $_SESSION[level] =
- }
- else
- {
- session_start()
- query = delete from users where md5 = $_COOKIE[sesiune]
- $newmd5 = md5($row[id]./random(10))
- setcookie(sesiune, md5($row[id]./random(10))
- update db write md5
- $_SESSION[id] =
- $_SESSION[level] =
- }
- }
- else
- {
- jet in pizda matii, stai nelogat
- keep old cookie
- }
- }
- // end pseudocod*/
Add Comment
Please, Sign In to add comment