Loging Script



It seems there is something wrong with my script for the reason that
it always returns, UserName NOT found . I know it connects to the db
fine because I don't get a error. So just been trying to figure out
what's wrong. I am using PEAR btw.

Pastebin: http://pastebin.ca/360410


<?PHP

require 'DB.php';


$db = DB::connect('mysql://lol:lol@localhost/user');

if (DB::isError($db)) {die('ERROR{1}: ' . $db-
getMessage()); }else{print "We connected";}

$user = $_POST['user'];
$password = md5($_POST['password']);
$password2 = md5($_POST['password2']);

$sql = check();



function check()
{
global $db;
global $user;


$rows = $db->getAll('SELECT user_name FROM user');
if (DB::isError($db)) {die('ERROR{2}: ' . $db->getMessage());}



if($user){
if(array_key_exists("$user", $rows)){print "<p><b>UserName
AcceptED</b>";}else{print "<p><b>UserName NOT found</b>";}

}else{print "<p>no username was typed";}

}

?>

.



Relevant Pages

  • Efficiency
    ... I wrote a script that built the SQL to examine text fields using a LIKE ... but for some reason or other I couldn't get it to work. ...
    (microsoft.public.access.queries)
  • Select Parameters in SQL data source
    ... I'm having a problem inserting a parameter into an SQL Select statement ... reason it just isn't working: ... If I hardcode the username into the Select statement, ...
    (microsoft.public.dotnet.framework.aspnet)
  • XP_cmdShell Error
    ... I am trying to below script on BOX1 ... But it is Blowing with below error. ... Reason: Not associated ... with a trusted SQL ...
    (microsoft.public.sqlserver.server)
  • Re: Pagination II
    ... the categories have enough entries to fill multiple pages. ... script runs and always goes to page 2 for some reason. ... Start with your SQL, once it's correct, then print it ...
    (comp.lang.perl.misc)
  • Re: Pagination II
    ... script runs and always goes to page 2 for some reason. ... Can anyone spot the problem? ... print $sql; ...
    (comp.lang.perl.misc)