Thread: GhettoLogin
nutballs

You gotta love when you can use Ghetto in a function name and actually be a legitimate use.
This function does no enforcement, but it sets a session var "usertype".
do your own enforcement from there. Just meant to be a quick and easy password login for a site that does not warrant a database.

usage

$security->ghettologin('nutballs','ghettopass',$_POST['user'],$_POST['pass'],'admin','/home.

php

 ');
$security->ghettologin('perk','biglongultraparanoidpass',$_POST['user'],$_POST['pass'],'

php

 nerd','/home.

php

 ');


function

  function ghettologin($validuser,$validpass,$user,$pass,$successusertype,$successtowhere='/')
  {
  //string as many of these 1 right after the other on a login page, as needed.
  if ($user != '' and $pass != '')
  {
if ($validuser == $user and $validpass == $pass)
{
$this->loggedinusertype = $successusertype;
$_SESSION['usertype'] = $successusertype;
header('Location:'.$successtowhere);
}
}
}

perkiset

oh I can see a whole new batch of interestingly named functions on the horizon... go NBs!

nutballs

yep, it makes perfect sense to me. this is the most ghetto of login functions I have ever made. lol
but hell, it works.

vsloathe

uber.


Perkiset's Place Home   Politics @ Perkiset's