Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,509,446 members, 5,718,280 topics. Date: Friday, 10 July 2020 at 12:39 PM

Login Applicatins - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Login Applicatins (774 Views)

Login Code In Vb6.0 / I Need A Help To Write A Simple Login Form Using Vb.net / [Code Request] Code for PHP Login And Signup (2) (3) (4)

(1) (Reply)

Login Applicatins by steepe(m): 2:11pm On Oct 25, 2007
Sorry guys, its me again! I'm just learning php and seem to have problems with creating a login application using sessions. Can anybody help?
Re: Login Applicatins by smartsoft(m): 2:54pm On Oct 25, 2007
paste the code you have
Re: Login Applicatins by steepe(m): 3:13pm On Oct 25, 2007
<?
$username = $_POST['username'];
$password = $_POST['password'];
if(isset($username)){
$conn = mysql_pconnect("localhost","root",""wink;
mysql_select_db("useraccount"wink;
//$sql = ;
//echo "sql = $sql";
$result = mysql_query("SELECT * FROM userauth WHERE username = '$username' AND pswd = md5('$password')"wink;
$rows = mysql_fetch_assoc($result);

if(is_array($rows)){
session_start();
$_SESSION['username'] = $rows['username'];
echo "do_login: name =".$_SESSION['username'];
//echo $rows['pswd'];
if($_GET['p']){
$page = $_GET['p'];
}else{
$page = "member.php";
}
//echo "page ".$page;
header("Location: ./$page"wink;
}
else
{
header("Location: ./fail.php"wink;
}
}


?>

(1) (Reply)

Pls Can Somebody Help Me / Ooad With Uml / Skills On "steroids"

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2020 Oluwaseun Osewa. All rights reserved. See How To Advertise. 22
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.