Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,149,817 members, 7,806,292 topics. Date: Tuesday, 23 April 2024 at 02:10 PM

Login Applicatins - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Login Applicatins (878 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)

In Need Of A Search Engine Application / Changing Career To A Software Tester In The Uk / Help In Php,java, Html And C#

(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 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.