hello all, i fairly new to php, I'm making a custom log in page, im useing a html form to proses the user name and password. I have a few questions
How does php check to see if the user and password is correct? any sample code would be help full
Thanks,
Mark
custom login?
Moderator: General Moderators
If you have a host with PHP and MySQL on it then this is a EXCELLENT tutorial:
http://robouk.mchost.com/tuts/tutorial. ... rial=login
http://robouk.mchost.com/tuts/tutorial. ... rial=login
-
NJ Termite
- Forum Newbie
- Posts: 6
- Joined: Fri Aug 30, 2002 11:59 pm
thanks for the link, one question do i put this code together like this?
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Login Signup!</title>
</head>
<body>
<form action="register.php" method="Post">
What is your desired Username? <input type="text" name="name"><br>
What is your password? <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
</body>
</html>
<?php
include('config.php');
$uname = $_POST['name'];
$upass = $_POST['password'];
$sql = "INSERT INTO $table VALUES ('', '$uname', md5('$upass'))";
if(!$result = mysql_query($sql)) die(mysql_error());
echo "Registered Successfully. <a href=\"login.html\">Continue</a> to the members page.";
?>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Login Signup!</title>
</head>
<body>
<form action="register.php" method="Post">
What is your desired Username? <input type="text" name="name"><br>
What is your password? <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
</body>
</html>
<?php
include('config.php');
$uname = $_POST['name'];
$upass = $_POST['password'];
$sql = "INSERT INTO $table VALUES ('', '$uname', md5('$upass'))";
if(!$result = mysql_query($sql)) die(mysql_error());
echo "Registered Successfully. <a href=\"login.html\">Continue</a> to the members page.";
?>