CircularStopSign Posted August 22, 2006 Share Posted August 22, 2006 i'm still working with the membership code and there isnt a checkuser.php can anyone give me a simple code to check if the username and password match, then send them to login_success.php?thanks in advance Quote Link to comment Share on other sites More sharing options...
Corona4456 Posted August 22, 2006 Share Posted August 22, 2006 http://www.phpfreaks.com/tutorials/40/5.phpThere's a checkuser.php there Quote Link to comment Share on other sites More sharing options...
trq Posted August 22, 2006 Share Posted August 22, 2006 Just do it in your query.[code=php:0]"SELECT uname, pword FROM users WHERE uname = '{$_POST['uname']}' AND pword = '{$_POST['pword']}'";[/code]If no results are returned they failed. Quote Link to comment Share on other sites More sharing options...
SharkBait Posted August 22, 2006 Share Posted August 22, 2006 [code]<?php$password = "mypass"$username = "user123"$strqry = "SELECT * FROM users WHERE password = '{$password}' AND username = '{$username}'";$query = mysql_query($strqry) or die("MySQL Error: <br />{$strqry} <br /> ". mysql_error());$num = mysql_num_rows($query);if ($num < 1) { // Password User not found in database or do not match} else { // Password/username is valid header("Location: login_success.php"); exit();}?>[/code]Gives you the jist of it :) Quote Link to comment 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.