Location: PHPKode > projects > mBlog > includes/login.php
<?php
require "user_init.php";

$user_id = post_param ('user_id');
$user_passwd = post_param ('user_passwd');

$res = sql_query ("SELECT user_id FROM m_user WHERE (user_id='$user_id' OR user_email='$user_id') AND user_passwd = '$user_passwd' LIMIT 1");
$row = sql_fetch_array ($res);
if (empty($row['user_id']))
{
	redir ($config['site_url'].'/msg.php?id=bad_login');
	die ();
}

// set cookies
setcookie ("m_user", "$user_id", time()+31536000, "/");
setcookie ("m_passwd", md5($user_passwd), time()+31536000, "/");

redir ($config['site_url']);
?>
Return current item: mBlog