Archive for December, 2003

Help for Herman

One of the Ensight readers recently submitted this in a comment, wondering if there was a better way to do it / way to fix it. I’m not a real deep PHP guy, but hopefully one of the readers can give him a hand.

Here’s the code in question:

function verify_login ($csLogin,$csPassword,$csSA,$csPwd) ( echo (“database.php – trace #1 “); @ $db = mysql_connect (‘localhost’,$csSA,$csPwd) or die (“Error: Could not connect to database”); echo (“database.php – trace #2 “);

if (!$db) ( echo (“Could not connect to database”); exit; }

echo (“database.php – trace #3 “);

mysql_selectdb (‘db_dynasoft’);

$sql = “SELECT * FROM TBL_CLIENT WHERE csLogin=’”.$csLogin.”‘ AND csPswd=’”.$csPassword.”‘”; echo ($sql);

@ $result = mysql_query ($sql);

if ($result) ( $num_results = mysql_num_rows ($result); if ($num_results > 0) ( $row = mysql_fetch_row ($result); session_register (‘csUid’,'csPwd’,'csLname’,'csFname’,'csMname’,'csCompany’); $_SESSION['csCompany'] = $row[1]; $_SESSIONS['csLname'] = $row[2]; $_SESSIONS['csFname'] = $row[3]; $_SESSIONS['csMname'] = $row[4]; $_SESSIONS['csUid'] = $row[5]; $_SESSIONS['csPwd'] = $row[6]; mysql_close ($db); return true; } else ( echo (“No rows returned”); mysql_close ($db); return false; } } else ( echo (“No result returned”); mysql_close ($db); return false; } mysql_close ($db); return false; }

Venturpreneur

I only just discovered this blog. It is really rather new, but the maturity displayed, and the quality of the posts are fantastic. Hopefully the writer will begin contributing to the Carnival of the Capitalists so that the world can see more of what he has to say.

Pay Venturpreneur a visit, you won’t be sorry.

New Computer

It’s amazing how much getting a new machine will throw off your week. I’m 3 hours in and I haven’t even installed Visual Studio, Photoshop or Quark.

Ah well, at least I still have Wi-Fi access.