Like a restricted area for members to log into? Usually you'll need a server-side language to process the login. I'm not exactly sure what you mean by "a real one"...
so my website has a point!
(if you want to see it you can just coppy this code and veiw it)
(it's not finished)
/<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link id="ctl00_Imports" rel="stylesheet" type="text/css" href="../CSS/AllCSS.ashx?v=19" />
<link rel="icon" type="image/vnd.microsoft.icon" href="../favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<meta name="author" content="ROBLOX Corporation" />
<meta name="description" content="Free Games and Building Games! A virtual world for kids with user-created castles, cars, spaceships, swords, battles, trucks, zombies and awesome destruction. Build, battle, chat, or just hang out online." />
<meta name="keywords" content="free games, online games, building games, virtual world" />
<title>ilikepie.com - all games</title>
<script type="text/javascript">
var c=0
var t
function timedCount()
{
document.getElementById('txt').value=c;
c=c+1;
t=setTimeout("timedCount()",1000);
}
function stopCount()
{
clearTimeout(t);
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1 ;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end));
}
}
return ""
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}
function checkCookie()
{
username=getCookie('username');
if (username!=null && username!="")
{
alert('Welcome again '+username+'!');
}
else
{
username=prompt('Please enter your name:',"");
if (username!=null && username!="")
{
setCookie('username',username,365);
}
}
}
</script>
<style type="text/css">
a:link {color:#000000} /* unvisited link */
a:visited {color:#000000} /* visited link */
a:hover {color:#00FF00} /* mouse over link */
a:active {color:#000000} /* selected link */
body {
background-image: url(xat_pool.jpg);
background-repeat: repeat-w;
}
You can use MS Front Page to create a web page with login form. However, I think you need to know about database to make "a real one". To make a simple website with login form, you can use Wordpress ( http://wordpress.org )
Here you are, a simple but effective login. If you're looking for a more complex example, you can find someone on the forum to build you one. Might cost you a couple bucks, but it's always easier than DIY!
processLogin.php
Code:
<?php
// entered is grabbed from previous page, reuiqred is hardcoded (or grabbed from database)
$passwordEntered = $_REQUEST['password'];
$passwordRequired = "yourpass"; // This is where you'd make your sql statement, comparing the users name to the password given for the users in your database
if($passwordEntered == $passwordRequired)
echo "Success";
//login is a successs
else
echo "failure";
//failure{
?>
you need to code a login form in a particular programming language that your server supports and connect with a database server.
Right you are. PHP, is my mama.
I already provided some code on how to confirm a "static password test". Heres a more dynamic version, in which you must use mysql to create a db, assign usernames and passwords (can be done with another form and another query) and validate them based on a query.
Code:
session_start();
// Get/Post Username/Password
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
// Connect & Query MySQL
include('connection.php');
// $query = "SELECT * FROM user WHERE id = '$username' AND password = md5('$password')";
$query = "SELECT * FROM user WHERE username = '$username' AND password = md5('$password')";
$result = mysql_query($query);
// Login, only if 1 result
if(mysql_num_rows($result) == 1){
session_regenerate_id();
$user = mysql_fetch_assoc($result);
$_SESSION['SESS_USER_ID'] = $user['username'];
$_SESSION['USER_NAME'] = $user['firstName']." ".$user['lastName'];
header("location: uploadFile.php");
exit();
}
else{
header("location: access-denied.php");
}
Bookmarks