<?php
session_start();
/**
* CODETREE
* support@mycodetree.com
* http://mycodetree.com
*
*/
if (isset($_POST['username']) && isset($_POST['password'])) {
foreach ($_POST as $key => $value) {
$_POST[$key] = trim(stripslashes($value));
}
$enc_password = md5($_POST['password']);
$username = $_POST['username'];
// Include MySQL database details
include_once '../includes/db.php';
mysql_select_db($db_name, mysql_connect($host, $dbusername, $dbpassword) or die(mysql_error()));
$sql = mysql_query("SELECT * FROM $tbl_name WHERE username='$username' and password='$enc_password'") or die(mysql_error());
$row = mysql_fetch_array($sql);
if (!$row) {
$err = "That password and user combination does not exist";
}
else {
$_SESSION['loggedin']['user'] = $_POST['username'];
}
}
?>
<table cellpadding='3' cellspacing='3' style='border: 1px solid #BBB;' width='100%'>
<?php
if (!is_null($err)) {
echo "<tr><td align='center'>$err</td></tr>";
}
?>
<tr>
<td>
<form action="scripts/checklogin.php" method="post">
<div>
<label for="username">Username:</label><br>
<input id="username" name="username" type="text"><br>
<label for="password">Password:</label><br>
<input id="password" name="password" type="password">
<input id="submit" type="submit" value="">
</div>
</form>
</td>
</tr>
</table>
Archive for July 15th, 2009
PHP — A simple login script
July 15th, 2009Lawyers claim ringtones are public performance
July 15th, 2009The American Society of Composer, Authors and Publishers (ASCAP) filed a lawsuit against telecoms giant AT&T, in which it told a federal court that ringtones fell under the public perfomance Copyright Act. ASCAP collects royalties and licences on behalf of 350,000 members in the US. In effect, the organisation is gunning for additional payments from mobile firms, and if they don’t cough up the royalties ASCAP could claim copyright infringement against mobile user … more
Legistalker — keep tabs on what US Congress folks are doing!
July 15th, 2009Web service that lets you track the latest online activity of US legislators (congressmen, senators) in one place. You can view what they have voted on (motions, amendments, resolutions etc.), browse news mentions in online media sources (newspapers, blogs, magazines, YouTube videos) and follow their Twitter updates.
Oh baby!
July 15th, 2009

