Re: Loging Script



On Sat, 17 Feb 2007 14:13:22 +0100, phyburn <phyburn@xxxxxxxxx> wrote:

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());}

Untested, I seldomly use PEAR::DB:

$stmt = $db->prepare('SELECT user_name, password FROM user WHERE user_name = ?');
$result = $db->execute($stmt,$user);
if($result->numRows()!=1) die('Username not found or multiple users with the same name.');
--
Rik Wasmus
.



Relevant Pages

  • DSADD doesnt work properly
    ... I've searched everywhere i can think of to add multiple users to active ... directory at once on windows 2003, and the closest i've come so far is dsadd ... physical $username$ in the path. ...
    (microsoft.public.windows.server.active_directory)
  • Re: How to invoke access application through command promt
    ... multiple users are going to use the application with different usernames and ... I have not created any access username and password. ... >> providing oracle username and password. ... > You cannot do this via startup switches. ...
    (microsoft.public.access.forms)
  • Scripting and creating home directories
    ... I recently wrote a script to create multiple users in AD. ... would like to accomplish is assign and create home directories. ... I tried substituting the actual username for %username% but it still does not ... Will I have to create a File System Object to create ...
    (microsoft.public.windows.server.scripting)
  • Re: Work tables
    ... Is there a preferred way of allowing multiple users to update an Access Bill ... I have tried adding a "UserName" field to the work table. ... I wondered whether to use a copy of the front end database whose name ...
    (microsoft.public.access.formscoding)
  • Work tables
    ... Is there a preferred way of allowing multiple users to update an Access Bill ... of Materials database. ... I have tried adding a "UserName" field to the work table. ... Peter Kinsman ...
    (microsoft.public.access.formscoding)