Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,200,284 members, 7,974,283 topics. Date: Sunday, 13 October 2024 at 07:50 PM |
Nairaland Forum / Science/Technology / Programming / Login Applicatins (899 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","" mysql_select_db("useraccount" //$sql = ; //echo "sql = $sql"; $result = mysql_query("SELECT * FROM userauth WHERE username = '$username' AND pswd = md5('$password')" $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" } else { header("Location: ./fail.php" } } ?>
|
(1) (Reply)
Please Helppppppppppp / I Need A Godfather In Java / Advice On Mobile App Development
(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. 9 |