ik heb hier mijn register.php

<?session_start();?>
<? require("include.php");
head();


if ($action == "register") {
if (!$_POST[username] OR !$_POST[email] OR !$_POST[pass1]) {
echo "There are missing fields, please fill in everything";
} elseif ($_POST[pass1] != $_POST[pass2]) {
echo "The passwords doesn't match, please try again";
} else {
$result = mysql_query("select * from users where username='$_POST[username]'");
if ($row = mysql_fetch_array($result)) {
echo "username is already in use, please try again";
} else {
$result = mysql_query("select * from users where email='$_POST[email]'");
if ($row = mysql_fetch_array($result)) {
echo "The email adres has already been used by another player, please try again";
} else {
$_POST['pass1'] = md5($_POST['pass1']);
mysql_query("INSERT INTO users (id, username, email, pass) VALUES (NULL, '$_POST[username]', '$_POST[email]','$_POST[pass1]')") or print(mysql_error());
echo "Thank you for registering, we have send you an email with your username and password";
mail("$_POST[email]", "Game Password", "Beste $_POST[username],\n\nBedankt voor uw aanmelding.\nhier vind u uw registratie gegevens\n\nGebruikersnaam: $_POST[username]\nWachtwoord: $_POST[pass2]\n\nMet vriendelijke groeten,\nErik Rijk.\n",
"From: Erik <[email protected]\r\n"
."Reply-To: From: Erik <[email protected]>\r\n"
."X-Mailer: PHP/" . phpversion());
}
}
}
} else {
?>
</head><title></title>
<body>
<form action="register.php?action=register" method="Post">
username:<br>
<input name="username" type="text" id="username" style="border-style: solid; border-width: 1"><br>
E-mail: <font color="red">please fill in a correct e-mail adres or else your account will be deleted</font><br>
<input name="email" type="text" id="email" style="border-style: solid; border-width: 1"><br>
Password:<br>
<input name="pass1" type="password" id="pass1" style="border-style: solid; border-width: 1"><br>
Password <font color="red">retype</font><br>
<input name="pass2" type="password" id="pass2" style="border-style: solid; border-width: 1"><br><br>
<input type="submit" name="submit" value="Register " style="font-family: Verdana; font-size: 8 pt; color: red; border: 1px solid red; background-color: black">
<input type="reset" name="reset" value="Clear " style="font-family: Verdana; font-size: 8 pt; color: red; border: 1px solid red; background-color: black">
</form>
</body>
<?
}


foot();
?>

en hier mijn include.php

<?
require("block.php"); //-- bijvoorbeeld als je dit scriptje block.php hebt genoemd.
?>

<head><STYLE TYPE="text/css">

td{
font-size:7pt;
}

body{
background:black;
color:white;
font-size:7pt;
font-family:verdana;
}

A: Link {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
A: Active {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
A: Hover {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
A: Visited {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
</STYLE></head>

<?
$mysql_server = "localhost";//mysql server
$mysql_pass = "";//wachtwoord
$mysql_login = "root";//gebruikersnaam
$mysql_database = "users";//database
$mysql_conn = mysql_connect ("$mysql_server", "$mysql_login", "$mysql_pass");
mysql_select_db("$mysql_database");

?>
<?
function head() {
?>
<html>
<head>
<title></title>
</head>
<?
echo "<a href=\"register.php\">Aanmelden</a> - ";
echo "<a href=\"inloggen.php\">Inloggen</a> - ";
echo "<a href=\"uitloggen.php\">Uitloggen</a> - ";
echo "<br><br>";
}

function foot() {
?>
</body>
</html>
<?
mysql_close();
}
?>

en hier de mysql tabellen

CREATE TABLE users (
id bigint(255) unsigned NOT NULL auto_increment,
username varchar(255) default NULL,
email varchar(255) default NULL,
pass varchar(255) default NULL,
PRIMARY KEY (id),
KEY id (id)
) TYPE=MyISAM;

nu wil ik er een inlog pagina bij hebben....
maar aangzien ik nog een php n00b ben die wel graag php wil leren, zou ik willen vragen of iemand voor mij een login pagina zou kunnen maken waar ik dan verder mee kan werken

Alvast Bedankt :)
oke thnx
slotje :)

Reageren