Jump to content

Search the Community

Showing results for tags 'login'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 30 results

  1. Hello everyone I want to make a login page and I want to connect it with loptop or mobile fingerprint scanner and people can login with their fingerprint. Can anyone help me what should I do?
  2. login dosent work, code correct?

    Hi W3S I am trying to make a login PHP code with MySQLI and it won't work for some reason, not sure what i have done wrong, can someone see what i did wrong? This is the code: //////////////////////////////////////////////////////////////////////////////////////////////////////// // Login //////////////////////////////////////////////////////////////////////////////////////////////////////// $SUBMIT_FORM_ACTION___TakeLoginForm = (isset($_GET["SUBMIT_FORM_ACTION"]) ? $_GET["SUBMIT_FORM_ACTION"] : ""); if( $SUBMIT_FORM_ACTION___TakeLoginForm == "TakeLogin" ) { $query_1 = "SELECT u_id, u_username, u_password, u_email FROM users WHERE u_email=? AND u_password=?"; if ( $stmt = $mysqli->prepare($query_1) ) { $FORM_email = $_POST['email']; $FORM_password = $_POST['password']; $stmt->bind_param('ss', $FORM_email, $FORM_password); $stmt->execute(); $stmt->bind_result($id, $username, $password, $email); $stmt->fetch(); // SECURITY! CHECK & COMPARE! if($FORM_password !== $password) { die(" <center><b>(Form) Login ErrMSG #1</b></center> <br /> <center>Password incorrect/wrong! Try again!</center> "); } // Make Sessions Needed! $_SESSION['user'] = array(); $_SESSION['user']['id'] = $id; $_SESSION['user']['username'] = $username; $_SESSION['user']['password'] = $password; $_SESSION['user']['email'] = $email; $stmt->close(); //header("location: index.php"); } } okay so lets see if i get this straight. In the bind_result part, this does not matter what kind of variable it is right? In the naming part... or does the names actual HAS to be like the ones in the Database Columns? I somehow think its the part there but correct me if i am wrong... Hoping someone can help me a little bit. Thanks in advance
  3. Hi all I would like to know whether it is possible or not to build a secure inlog script. The script I have as example is mainly in php. I read a couple of tuts online and watched some youtube video's and discovered that both javascript and php are used. I dont know much about encryption but more and more questions are rising ..... Is it true that it is possible to add javascript encryption wen you want a user to login ? My own idea is that this looks quite insecure as anybody can see the encryption code. I have more questions but first i would like to know this if possible.
  4. Greetings beloved Gurus! I would like some advice on how to go about creating a PHP registration/login system that grants access to all services on a website that has various sections, much like Google; e.g. I have got a Gmail account and subsequently been granted access to all of Google's services like Blogger, Youtube etc. Now I would like to do the same with my website, and grant the users access to all the services with one account registration. I am fairly new to PHP, I have only been tinkering around with it for five months now. I hope my question is not ambiguous or too broad, I need help with how I should approach this, so any pointers with regards to the structure of the database, frameworks, resources, and anything I should take into account would be much appreciated. I am ready to jot down your suggestions. Thank you!
  5. APPML authentication

    hi please help me with and example of APPML authentication, i am working on a full fledge applcaition bases on APPML, not able to crack authentication though.
  6. Hello everyone, I'm brand new to PHP and MySQL and I'm trying to build a login/register form for my company's website. I've literally scavenged the internet for the past 3 days and have watched multiple tutorials but still can't get my database to link to the php file(s). If anyone can guide me in the right direction or provide a dummy proof tutorial, it would be greatly appreciated!!! (I would attach my php code but I literally have nothing and have gotten no where) Any advice would help. Thanks!
  7. [TUTORIAL] Basic PHP Login System.

    Here's a fully working login system. Where users can sign up and access a members page. Features Include: - Login & Sign Up Page - Members Page Only **NOTE: I have not added any security code, you'll need to add this by yourself...** Step 1: Creating a Login and Sign Up Form. This will be a simple login page where users can enter their username and password, then click the submit button to access the members page. "login.php" will be the script that will be executed when they login. This processes the user information entered to check the validity through a database of users. HTML LOGIN FORM:<form method="post" action="login.php"><input type="text" placeholder="username" name="username"><input type="password" placeholder="password" name="password"><input type="submit" value="Submit"></form> This will be a simple register page where users can enter their desired username and password, then click the submit button to register button to make an account. "register.php" will be the script that will be executed when they register. This processes the user information and enters the information to the database <form method="post" action="register.php"><input type="text" placeholder="Desired Username"><input type="password" placeholder="Desired Password"><input type="password" placeholder="Password Again"><input type="submit" value="Register"></form> Step 2: Creating the login.php and register.php scripts Login Script<?phpsession_start(); //Starts User Session... will explain laterinclude("connect.php")//I'm going to assume you know how to connect to a database.$username = $_POST["username"];$password = $_POST["password"];//Sanitize DATA HERE//Assuming you have the corresponding column names...$q = mysqli_query($connect, "SELECT * FROM users WHERE username='$username' AND password='$password' ")$numrows = mysqli_num_rows($q);//Here we get the number of rows that correspond with the users informationif($numrows == 1){//If the number of rows is equal to 1, let them loginwhile($rows = mysqli_fetch_assoc($q)){//Here we retrieve values from database and initiate SESSION Variables $_SESSION["username"] = $row["username"]; $_SESSION["password"] = $row["password"];}header("location: memberspage.php")//redirect to members page... information correct.} else {header("location: index.php")//go back to login page... information incorrect.//error message here...} Register Script<?phpsession_start(); //Starts User Session... will explain laterinclude("connect.php")//I'm going to assume you know how to connect to a database.$username = $_POST["username"];$password = $_POST["password"];$password2 = $_POST["confirm"];//Sanitize DATA HEREif($password == $password2){//Assuming you have the corresponding column names...$q = mysqli_query($connect, "SELECT * FROM users WHERE username='$username'")$numrows = mysqli_num_rows($q);//Check if username is taken...if($numrows == 0){//If the number of rows is equal to 0, let them register$q = mysqli_query($connect, "INSERT INTO users (username, password) VALUES ('$username', '$password")header("location: index.php")//redirect to login page//login success message here} else {header("location: index.php")//go back to login page//username taken message}} else {//password no match message} Step 3: Members Page This is the members page... you can only access this page after login. memberspage.php<?phpif(!isset($_SESSION["username"])){//IF user is not logged in, redirect to login page. This checks whether the username session var has been created yet.header("location: index.php");}//else... load the members page?><!DOCTYPE html><!--HTML HERE FOR MEMBERS PAGE--> This is pretty much it... Remember to change column names where necessary... Don't forget the connect.php file ! Its is suggested you change mysqli_query() to prepared statements. You can do this on your own.
  8. how to set a login page

    hello so i created a registration page in html and a php code to connect to a database and enter the information to the database that all works. Now i want to ask if the user wants to log in would they need a separate php code to have a sort of certification that the account is valid? i made a html page for login but i need it to look back to the database to see if the user is registered so they can log in, not just anyone can log in...any ideas? or advice where i can find information about this? i see a lot of tutorials for making a log in page, making a registration page but how about when someone registers and wants to log in but to make sure the database can also check to see if the user is registered.
  9. Hi, I am working on a website that users can log into from one page and administrate their users from another. first page is index.php and second is admin.php. on the index page I have a form to login with that calls out to a stand alone .php script called "checklogin.php" here is the code... <?php ob_start(); $host=; // Host name $username=; // Mysql username $password="; // Mysql password $db_name="; // Database name $tbl_name="; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $login and $pass $login=$_POST['login']; $pass=$_POST['pass']; // To protect MySQL injection (more detail about MySQL injection) $login = stripslashes($login); $pass = stripslashes($pass); $login = mysql_real_escape_string($login); $pass = mysql_real_escape_string($pass); $sql="SELECT * FROM Registration WHERE login='$login' and pass='$pass'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $login and $pass, table row must be 1 row if($count==1){ session_register("login"); session_register("pass"); header("location:Admin.php"); } else { echo "<script language='javascript'> alert('Sorry, but you must login to view the members area!') </script> <script> window.location='index.php' </script>"; } ob_end_flush(); ?> my admin page has this script on it as a redirect... <?php session_start(); if(!session_is_registered(login)){ header("admin.php"); } ?> my question is...how can I echo out user specific data with this code onto the admin page in a div? since the code is living outside the admin page, I cant figure out how to do it...any help, thanks!
  10. hello i need help with a simple javascript simple login form, i am building a small website for I and my classmates. i want it to be able to redirect each user to a specific page when a corresponding passcode is entered, i know its unsafe but we dont plan on keeping valuable information on the site, i dont know about MSQL and dont even wish to use it, the code works at this level but am unable to add users since i dont understand javascript if someone could help me i will be very grateful thanks in advance /*here is the code i got so far*/<tittle>Enter Passcode to proceed</title><h1 style="font-family:Comic Sans Ms;text-align="center";font-size:20pt;color:#00FF00;></h1><form name="login">Passcode: <input type="text" name="userid"/><input type="button" onclick="check(this.form)" value="Login"/><input type="reset" value="Cancel"/></form><script type="text/javascript">function check(form)/*function to check userid */{ /*the following code checkes whether the entered userid is correct*/ if(form.userid.value == "JohnDoe") { window.open("johndoe.php")/*opens the target page while Id */ } else { alert("Invalid Passcode, please try again!")/*displays error message*/ }}</script>
  11. Hi guys. iv question about login and logout how can i write a script for login and logout? thnx
  12. authentication problem

    i got problem somewhere while trying to authenticate users while loging in. what i wrote to authenticate in classuser file is this-- // start authentication $safeUser = $mysqli->real_escape_string($username); $incomingPass = $mysqli->real_escape_string($password); $query = "SELECT * FROM user WHERE username = '{$safeUser}'"; if (!$result = $mysqli->query($query)) { error_log("Cannot retrieve account record for {$username}"); return false; } // no while loop for single row $row = $result->fetch_assoc(); $dbPass = $row['password']; if (crypt($incomingPass, $dbPass) != $dbPass) { error_log("Wrong Password for {$username}!"); return false; } i've mysql table 'user' and columns 'username' & 'password'. while trying loging in with valid username & password also it gives username & password related error. both username & password are recorded in CHAR(10) type.....
  13. How to grant access to only selected passcode? And to need to login into Disqus profile ( http://disqus.com/ ). 1.- So I give user a passcode that he than uses to access member-only stuff (so, it's a closed site) 2.- and later on he uses his/her Disqus profile to be part of community. 3.-and to have pc/ device remember that passcode was already inputted (like on Steam where you have to give you pc/ device a name) Thank you
  14. How to grant access to only selected passcode? And to need to login into Disqus profile ( http://disqus.com/ ). 1.- So I give user a passcode that he than uses to access member-only stuff (so, it's a closed site) 2.- and later on he uses his/her Disqus profile to be part of community. 3.-and to have pc/ device remember that passcode was already inputted (like on Steam where you have to give you pc/ device a name) Thank you
  15. login script

    every time i log in i get a good message displaying, you have been logged in, but then when i try to click on another link it automatically loges me out why? <?php session_start(); ?> <html> <head> <link href='style/style.css' rel='stylesheet' type="text/css" /> <title>Login</title> <meta name='login' content='login to itsnature' /> <meta name='keywords' content='login' /> </head> <body> <h1>Login</h1> <?php require_once "connect.php"; // sets a navigator if(isset($username)) { include "navigator/navigator_login.php"; } else { include "navigator/navigator.php"; } // login form $login = "<form action='login.php' method='POST' name='login1' class='forgotpass'> <input type='text' name='username' placeholder='Username' /> <br /> <input type='password' name='password' placeholder='Password' /> <input type='submit' name='submit' value='Login' /> | <a href='register.php'>Register</a> </form>"; // includes a navigator if(isset($username)) { echo "<p>Welcome $username.</p> <br />"; } else { if(isset($_POST['username']) && isset($_POST['password'])) { $username = mysqli_real_escape_string($con, $_POST['username']); $password = mysqli_real_escape_string($con, $_POST['password']); } if(isset($username) && isset($password)) { $password = md5($password); $query = mysqli_query($con ,"SELECT * FROM users WHERE username='$username' && password='$password'"); $numrows = mysqli_num_rows($query); if($numrows != 0) { $_SESSION['username'] = $username; echo "<p>You have been logged in.</p> <br />"; } else { echo "<p>Wrong password or username.</p>$login"; } } else { echo "<p>You must register an account in order to login.</p>$login"; } } mysqli_close($con); ?>
  16. Hello. Please understand that I am very new to HTML. I am going to post what I need to accomplish and then hopefully someone can guide me on how to make it happen. I need to create a login page on my website so that a user can login using a specific username and password and be directed to a URL based on the username and password they entered. For instance I have a folder on my server that I am using to store data specific to a client named Kenneth. The URL might be www.mysite.com/kenneth - When Kenneth goes to my website and accesses the “Client Login Page” he will see a form to enter Username and Password and click Submit. When he enters his username and password correctly and clicks submit it would guide him to a folder on my server where he can access his data. I would like any client to have the same functionality- so for instance if Sally enters her username and password she would be guided to her own space on my server. Does that make sense and is it possible to accomplish? Thank you for your help!
  17. Grants Website

    Guys iam frm ECE back ground and am facing trouble in doing my assigned task but i need to do that if i have to survive please help me guys.Pls give me a detailed explanation guys.please help me guys . Purpose: The Grants application website/dashboard is for Grants Chair(s),. Applicants, and Readers to Submit applications, Review & Score, Rank, Database Information Entry Applicants & Readers must be able to create a profile and login (using NetID & Password) o User Prolife Information: ß Username ( NetID) ß Banner ID # (ex. 100231973) ß First Name ß Last Name ß Contact Information Email (email recommended, generate verification email) Phone # Address (Street, City, State, Zip Code, Country) ß Password (allow custom entry, double/matching entry required, default to Banner ID#) ß Department (Choose from Dropdown list) ß Perspective Choose From Dropdown list) ß Specify Applications reading/applying for (X,Y,Z) o Upon creation, Readers should be assigned a unique identifier (6-digit #) for confidentiality purposes. o Each Application should receive its own unique identifier (6-digit #) for confidentiality purposes. On logging in user should go to his dashboard Dashboard: (User Home) List of Grants Offered & Amounts (X,Y,Z AND $100,$500,$1000) *View the application of his own Downloadable pdf’s A,B,C files Downloadable Score Spreadsheet (Blank, Excel) Calendar (Google) Showing Cycle Dates, Application Dates, Reader Dates, Response Dates (6- weeks after application)
  18. Grants Website

    Guys iam frm ECE back ground and am facing trouble in doing my assigned task but i need to do that if i have to survive please help me guys.Pls give me a detailed explanation guys.please help me guys . Purpose: The Grants application website/dashboard is for Grants Chair(s),. Applicants, and Readers to Submit applications, Review & Score, Rank, Database Information Entry Applicants & Readers must be able to create a profile and login (using NetID & Password) o User Prolife Information: ß Username ( NetID) ß Banner ID # (ex. 100231973) ß First Name ß Last Name ß Contact Information Email (email recommended, generate verification email) Phone # Address (Street, City, State, Zip Code, Country) ß Password (allow custom entry, double/matching entry required, default to Banner ID#) ß Department (Choose from Dropdown list) ß Perspective Choose From Dropdown list) ß Specify Applications reading/applying for (X,Y,Z) o Upon creation, Readers should be assigned a unique identifier (6-digit #) for confidentiality purposes. o Each Application should receive its own unique identifier (6-digit #) for confidentiality purposes. On logging in user should go to his dashboard Dashboard: (User Home) List of Grants Offered & Amounts (X,Y,Z AND $100,$500,$1000) *View the application of his own Downloadable pdf’s A,B,C files Downloadable Score Spreadsheet (Blank, Excel) Calendar (Google) Showing Cycle Dates, Application Dates, Reader Dates, Response Dates (6- weeks after application)
  19. Grants website

    Guys iam frm ECE back ground and am facing trouble in doing my assigned task but i need to do that if i have to survive please help me guys.Pls give me a detailed explanation guys.please help me guys . Purpose: The Grants application website/dashboard is for Grants Chair(s),. Applicants, and Readers to Submit applications, Review & Score, Rank, Database Information Entry Applicants & Readers must be able to create a profile and login (using NetID & Password) o User Prolife Information: ß Username ( NetID) ß Banner ID # (ex. 100231973) ß First Name ß Last Name ß Contact Information Email (email recommended, generate verification email) Phone # Address (Street, City, State, Zip Code, Country) ß Password (allow custom entry, double/matching entry required, default to Banner ID#) ß Department (Choose from Dropdown list) ß Perspective Choose From Dropdown list) ß Specify Applications reading/applying for (X,Y,Z) o Upon creation, Readers should be assigned a unique identifier (6-digit #) for confidentiality purposes. o Each Application should receive its own unique identifier (6-digit #) for confidentiality purposes. On logging in user should go to his dashboard Dashboard: (User Home) List of Grants Offered & Amounts (X,Y,Z AND $100,$500,$1000) *View the application of his own Downloadable pdf’s A,B,C files Downloadable Score Spreadsheet (Blank, Excel) Calendar (Google) Showing Cycle Dates, Application Dates, Reader Dates, Response Dates (6- weeks after application)
  20. Hello everyone, sorry for the dull title. Couldn't think of anything better. So this is my problem.I was using a registration form for teachers and one for students. There are ten fields in each, first name, last name, username, password, etc being similar whereas departments (teachers have 7, students have 3) and email ids (teachers have a different domain extension and students different) being different. I am using two tables, one for teachers and one for student.Now, I know I can use one login form, query against these two tables using the JOIN property and make them login. But I want to know if this method is efficient because two tables are being used.Or is this method more efficient: In the reg form, I put a radio button to select teacher or student and depending on what one chooses the remaining fields change, i.e, if I choose teacher, 7 departments show up or if I choose student only 3 of them show up. In this way, I have to use one table only, atleast I guess so.Or another possibility is I use two tables but two login forms, one for teacher and one for student, I know this is the easy way out but being a Comp Sci student I want to choose the efficient method of all.P.S: The teacher's role is going to be completely different from the student's in the site. And there will be lot of activities for the teachers and students, they are completely different. Will maintaining one table be a good bet?Thank you.
  21. login script help

    I have a login function in my site.I have used if($count==1){$row = mysql_fetch_array($result); print ("login success");}else{print ("wrong!");} I wanna if the If condition true it will give a success msg and redirect the previous page. Else it will show a login wrong message with javascript alert box with ok button. How can i do it? please help me anybody.......
  22. How to will it be ?

    I have a login function in my site http://www.learn24bd.com. In my database every register member has their data, Like name,e-mail,etc. At the time of login user needs to put his/her email and password.I wanna if a user login successfully, a message will display on login success page Welcome (The name which has saved in my database in name field) Example: Welcome MD.Harun-Ur-Rashid Please any body help me.
  23. Problem using different type of names to login

    hey guys, long time no see, im having a problem using a nickname or a email to log into a website i have everything layout but its not working im not sure what im doing wrong thats why i came here for a few pointers or tip this is what my query looks like $log = "SELECT * FROM members WHERE nick='$username' OR email='$username' AND password='$password'"; and this is what the html code looks like <form action="" method="post">Username: <input type="text" name="username" /> Password: <input type="password" name="password" /> <input type="submit" name="submitt" value="Login" /></form> what i was planning is when you enter either a email or username it still logs you in as long as the information is within the database but so far im only being able to use the username only
  24. my login does not working...

    yoyo w3s...im having a little trouble with my login page... here you can see the example: http://speed-scene.c...scene/login.php anyways, i allready knew about sessions and such, so i was thinking that it was time to expand my knowledge a little. so i was trying to make a login page that was using cookies to log me in, and while expanding, i was thinking that i could try it out on one of my projects on the following link i have allready given. but the trouble is that when im trying to login, then im just staying at the same page, and nofthing by then happends... here is all my login codes/pages im using: 1. bittorrent.php inside include folder from root (The functions im using to get the login thing to work...): function dbconn($autoclean = false){global $SS;if (!@mysql_connect($SS['mysql_host'], $SS['mysql_user'], $SS['mysql_pass'])){ switch (mysql_errno()) { case 1040: case 2002: if ($_SERVER['REQUEST_METHOD'] == "GET") die("<html><head><meta http-equiv='refresh' content=\"5 $_SERVER[REQUEST_URI]\"></head><body><table border='0' width='100%' height='100%'><tr><td><h3 align='center'>The server load is very high at the moment. Retrying, please wait...</h3></td></tr></table></body></html>"); else die("Too many users. Please press the Refresh button in your browser to retry."); default: die("[" . mysql_errno() . "] dbconn: mysql_connect: " . mysql_error()); }}mysql_select_db($SS['mysql_db']) or die('dbconn: mysql_select_db: ' . mysql_error());//mysql_query("SET NAMES utf8");mysql_set_charset('utf8');userlogin();if ($autoclean) register_shutdown_function("autoclean");} /*LOGIN FUNCTIONS*/function sqlesc($x) {return "'".mysql_real_escape_string($x)."'";}function mkglobal($vars) {if (!is_array($vars))$vars = explode(":", $vars);foreach ($vars as $v) {if (isset($_GET[$v])) $GLOBALS[$v] = unesc($_GET[$v]);elseif (isset($_POST[$v])) $GLOBALS[$v] = unesc($_POST[$v]);else return 0;}return 1;}function set_mycookie( $name, $value = "", $expires_in = 0, $sticky = 1 ){ global $SS; if ( $sticky == 1 ){ $expires = time() + 60*60*24*365;} else if ( $expires_in ) { $expires = time() + ( $expires_in * 86400 ); } else { $expires = FALSE; } $SS['cookie_domain'] = $SS['cookie_domain'] == "" ? "" : $SS['cookie_domain']; $SS['cookie_path'] = $SS['cookie_path'] == "" ? "/" : $SS['cookie_path']; if ( PHP_VERSION < 5.2 ) { if ( $SS['cookie_domain'] ) { @setcookie( $SS['cookie_prefix'].$name, $value, $expires, $SS['cookie_path'], $SS['cookie_domain'] . '; HttpOnly' ); } else { @setcookie( $SS['cookie_prefix'].$name, $value, $expires, $SS['cookie_path'] ); }}else{ @setcookie( $SS['cookie_prefix'].$name, $value, $expires, $SS['cookie_path'], $SS['cookie_domain'], NULL, TRUE );}}function logincookie($id, $passhash, $updatedb = 1, $expires = 0x7fffffff){set_mycookie( "uid", $id, $expires );set_mycookie( "pass", $passhash, $expires );if ($updatedb) @mysql_query("UPDATE users SET last_login = ".TIME_NOW." WHERE id = $id");}function logoutcookie() {set_mycookie('uid', '-1');set_mycookie('pass', '-1');}function loggedinorreturn() {global $CURUSER, $SS;if (!$CURUSER){ header("Location: {$SS['baseurl']}/login.php?returnto=" . urlencode($_SERVER["REQUEST_URI"])); exit();}}function get_mycookie($name){global $SS; if (isset($_COOKIE[$SS['cookie_prefix'].$name]) AND !empty($_COOKIE[$SS['cookie_prefix'].$name])) { return urldecode($_COOKIE[$SS['cookie_prefix'].$name]); } else { return FALSE; }}function userlogin() {global $SS;unset($GLOBALS["CURUSER"]);$ip = getip();$nip = ip2long($ip);require_once "cache/bans_cache.php";if(count($bans) > 0){foreach($bans as $k) { if($nip >= $k['first'] && $nip <= $k['last']) { header("HTTP/1.0 403 Forbidden"); print "<html><body><h1>403 Forbidden</h1>Unauthorized IP address. Please, piss off... you had your chance.</body></html>\n"; exit(); }}unset($bans);}if (!$SS['site_online'] || !get_mycookie('uid') || !get_mycookie('pass'))return;$id = 0 + get_mycookie('uid');if (!$id || strlen( get_mycookie('pass') ) != 32)return;$res = mysql_query("SELECT * FROM users WHERE id = $id AND enabled='yes' AND status = 'confirmed'");// or die(mysql_error());$row = mysql_fetch_assoc($res);if (!$row)return;if (get_mycookie('pass') !== $row["passhash"])return;mysql_query("UPDATE users SET last_access='" . TIME_NOW . "', ip=".sqlesc($ip)." WHERE id=" . $row["id"]);// or die(mysql_error());$row['ip'] = $ip;$GLOBALS["CURUSER"] = $row;}/*LOGIN FUNCTIONS*/ 2. this is my password_functions.php file inside include folder from root: <?phpfunction mksecret($len=5){ $salt = ''; for ( $i = 0; $i < $len; $i++ ) { $num = rand(33, 126); if ( $num == '92' ) { $num = 93; } $salt .= chr( $num ); } return $salt;} function make_passhash_login_key($len=60){ $pass = mksecret( $len ); return md5($pass);} function make_passhash($salt, $md5_once_password){ return md5( md5( $salt ) . $md5_once_password );} function make_password(){ $pass = ""; $unique_id = uniqid( mt_rand(), TRUE ); $prefix = mksecret(); $unique_id .= md5( $prefix ); usleep( mt_rand(15000,1000000) ); mt_srand( (double)microtime()*1000000 ); $new_uniqueid = uniqid( mt_rand(), TRUE ); $final_rand = md5( $unique_id.$new_uniqueid ); mt_srand(); for ($i = 0; $i < 15; $i++) { $pass .= $final_rand{ mt_rand(0, 31) }; } return $pass; }?> 3. this is my login.php file from root: <?phprequire_once("include/bittorrent.php");echo stdhead("Login");?> <form method="post" action="takelogin.php"><table class="login_table" align="center" border="1"><tr><td>Username</td><td><input type="text" name="username" id="username" size="35" /></td></tr><tr><td>Password</td><td><input type="password" name="password" id="password" size="35" /></td></tr><tr><td align="center" colspan="2"><input type="submit" name="login_submit" value="Login Now!" /></td></tr></table></form> <?phpecho stdfooter();?> 4. and at last, this is my takelogin.php file from root: <?phprequire_once 'include/bittorrent.php';require_once "include/password_functions.php";echo stdhead("Login");if (!mkglobal('username:password'))die();dbconn();$lang = array_merge(load_language('takelogin'));$res = mysql_query("SELECT id, passhash, secret, enabled FROM users WHERE username = " . sqlesc($username) . " AND status = 'confirmed'");$row = mysql_fetch_assoc($res);if (!$row)stderr($lang['tlogin_failed'], 'Username or password incorrect');if ($row['passhash'] != make_passhash($row['secret'], md5($password)))stderr($lang['tlogin_failed'], 'Username or password incorrect');if ($row['enabled'] == 'no')stderr($lang['tlogin_failed'], $lang['tlogin_disabled']);logincookie($row['id'], $row['passhash']);header("Location: {$SS['baseurl']}/index.php");echo stdfooter();?> and now to the big question, what the heck is wrong since i cannot login?... ideas where to check... it seems for my eye that i cannot see where to edit, since its all looking pretty well for both me and 1 other guys online i am coding with sometimes ... but the login does not work, so it is obviously that the codes does not either...but in anyways... i would be very much happy if anyone in here could tell me where to have my eyes on... thanks alot! ... PS: if wish to see the whole project, then you can use the following .FTP user to grand acces to the server and read the files, just in case you need more information.. HOST: blackbitt.comUSER: ftp_reader@blackbitt.comPASS: Reader1PORT: 21 bittorrent.php file is the main design to the whole site, and all my functions. in this way i have maked a Global Based design... Hoping you guys once more can guid me on to the right road again, thanks alot in advance! ...
  25. I am trying to set up a mysql/php login and register system but whenever i try it fails. I was wondering if someone could write code that can do this with the following things: Database name = DBNAMEDatabase tabel = DBTABLEHost name = EXAHOST.COMHost username = HOSTUSERHost password = HOST PASSWebsite name = WEBNAME.ORG If anymore things are needed please tell me, and if someone could make one that works i would REALLY appreciate it Thanks
×