saltpetre Posted August 6, 2006 Share Posted August 6, 2006 heyWhat am i doing wrong here.I got this code from a site and i followed the instruction to the teeth. But it's not working. I had modified it but still not working.The Problem is that after the user enters the user name and pass the user does not get redirect to main.php instead it just sits there with a blank page and the url reads http://localhost/re/userlogin.php (where userlogin.php is the page where the user types his user and pass.This is the orginal code:<?php// we must never forget to start the sessionsession_start();$errorMessage = '';if (isset($_POST['txtUserId']) && isset($_POST['txtPassword'])) {// first check if the number submitted is correct$number = $_POST['txtNumber'];if (md5($number) == $_SESSION['image_random_value']) {include 'settings/config.php';include 'settings/opendb.php';$userId = $_POST['txtUserId'];$password = $_POST['txtPassword'];// check if the user id and password combination exist$sql = "SELECT user_idFROM tbl_auth_userWHERE user_id = '$userId'AND user_password = PASSWORD('$password')";$result = mysql_query($sql) ordie('Query failed. ' . mysql_error());if (mysql_num_rows($result) == 1) {// the user id and password match,// set the session$_SESSION['image_is_logged_in'] = true;// remove the random value from session$_SESSION['image_random_value'] = '';// after login we move to the main pageheader('Location: http://qts-corp.com');exit();}else {$errorMessage = 'Sorry, wrong user id / password';}include 'settings/closedb.php';}else {$errorMessage = 'Sorry, wrong number. Please try again';}}?>If anyone can help , it would be much appreciated.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/16691-need-help-login-system-newbie-here/ Share on other sites More sharing options...
scheols Posted August 6, 2006 Share Posted August 6, 2006 here try looking at this.find the php code and try and learn from it and you should be okay mate.else if you cant try search php on pixel2life.com and search the member system options no the left side of the screen.[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/16691-need-help-login-system-newbie-here/#findComment-70306 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.