session_start();
//mysql connection string [start]
$connect = mysql_connect("localhost","mysql_user","mysql_passwd") or die
(mysql_error());
mysql_select_db("DB_Name", $connect) or die (mysql_error());
//mysql connection string [end]
$username = $_POST['username'];
$userpass = md5($_POST['userpass']);
$sql = "SELECT username FROM usertable WHERE username = '%s' AND password =
'%s'";
$result = *mysql*_query(sprintf($sql, $username, $userpass));
if (*mysql*_num_rows($result) > 1) {
$_SESSION['username'] = "$username";
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
// any other data needed *to* navigate the site or
// *to* authenticate the user can be added here
*in*clude "membersection.*php *";
} else {
$error = "Log *in* failed";
*in*clude "log*in_*form.*php*";
}
===============================================================
On 3/15/07, Jarlo Nicholas Solde <[EMAIL PROTECTED]> wrote:
Bai mao ni akong code sa php:
session_start();
$username = $_POST['username'];
$userpass = md5($_POST['userpass']);
$sql = "select * from usertable where username='$username' and
password='$userpass'";
$result = *mysql*_query($sql);
if (*mysql*_num_rows($result)!= 1) {
$error = "Log *in* failed";
*in*clude "log*in* form.*php*";
} else {
$_SESSION['username'] = "$username";
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
// any other data needed *to* navigate the site or
// *to* authenticate the user can be added here
*in*clude "membersection.*php *";
}
Walay may nahitano bai error: *Warning*: mysql_connect() [
function.mysql-connect<http://localhost/html/login/function.mysql-connect>]:
Can't connect to MySQL server on ' 192.168.1.140' (10060) in *C:\Program
Files\xampp\htdocs\html\login\conn.php* on line *2*
Could not Connect to the server
On 3/15/07, Richard Badlisan <[EMAIL PROTECTED]> wrote:
>
> hala master matt, dili na ka gakaligo? basin dili na ka madecrypt
> balik.. nah.. lisud na. mapareha ka sa md5 na one-way lang... try daw ligo
> basin madecrypt usab imo pagkaguapo..
>
> OT tu dili? dili... :p related man.
>
> 2007/3/15, Matt Arnilo S. Baluyos <[EMAIL PROTECTED]>:
> >
> > [OT]
> >
> > Aw, mas ganahan ko dinhi balay trabaho... kay dili ko gaka-late...
> > pwede pa gyud dili maligo. Hahaha.
> > bai
> > Mingaw lang nuon.
> >
> >
> --
> "Nais kong magpakasabog dahil olats ako kahit ano hithitin, kahit
> tambutso. Kukuha ako ng beer at ipapakulo sa kaldero't lalanghapin ang usok
> nito. Lahat ay aking gagawin upang hindi ko na isiping NAG-IISA NA AKO.."
> (Beer-Itchyworms)
>
> »›richard m badlisan
> » http://goma.co.nr
> » http://g0ma.blogspot.com
> » [EMAIL PROTECTED]
> » EOF
> _________________________________________________
> Kagay-Anon Linux Users' Group (KLUG) Mailing List
> [email protected] ( http://cdo.linux.org.ph)
> Searchable Archives: http://archives.free.net.ph
>
--
Mr. Jarlo Nicholas L. Solde
" In God We Trust"
_________________________________________________
Kagay-Anon Linux Users' Group (KLUG) Mailing List
[email protected] (http://cdo.linux.org.ph)
Searchable Archives: http://archives.free.net.ph
--
Camilo Lozano III
BS Information Management
Mobile #: 0916-3338326
Telephone #:
Iligan City: (063) 221-1122
Cagayan de Oro City: (088) 350-7211
http://www.metacatalyst.org
http://camilord.metacatalyst.org
http://www.zabyer.org
http://klug.metacatalyst.org/
http://forum.xu.edu.ph
http://forum.xu.edu.ph/linux/index.php (my linux knowledge)
-------
Got my Own Hacker Key:
v3sw3BHhw5ln2pr5OFPck3ma2u4MLw5XVm+5l5UCi5Ne4t3b5en5g5RaIs5MSr3p2
http://www.hackerkey.com
Registered Linux User: #439468
_________________________________________________
Kagay-Anon Linux Users' Group (KLUG) Mailing List
[email protected] (http://cdo.linux.org.ph)
Searchable Archives: http://archives.free.net.ph