vorrei che gli utenti si registrassero al mio sito in seconda da logarsi in login come fare?
se mi spiegate come potrei metterlo in pratica.

index.php
<?php
header("Location: http://simplestore.altervista.org/pagina-637335.html");
ma se gia ce un index sul database quando lo inserisco mi dice di sovrascrivere.
che devo fare?

login.php
questo lo metto in database, e poi lo inserisco come codice html dal sito
e giusto? o manda qualcosa perche non succede niente e non vedo nessun login sul sito.
aiutatemi grazie

<?
//text
$text1 = "Field \"username\" or \"password\" is empty! Please fill in the form.";
$text2 = "Incorrect \"username\" or \"password\"!";
$file3 = "file.php"; //enter file to logon to

//username and password

$username[1] = "demo"; // user1: demo
$password[1] = "demo";

#$username[2] = "admin"; // user2: admin
#$password[2] = "admin";

#$username[3] = "test"; // user3: test
#$password[3] = "test";

#$username[4] = ""; // user4: ---
#$password[4] = "";

#$username[5] = ""; // user5: ---
#$password[5] = "";

#$username[6] = ""; // user6: ---
#$password[6] = "";

#$username[7] = ""; // user7: ---
#$password[7] = "";

#$username[8] = ""; // user8: ---
#$password[8] = "";

#$username[9] = ""; // user9: ---
#$password[9] = "";

#$username[10] = ""; // user10: ---
#$password[10] = "";

if (!$submit) {
$submit = isset($_POST['user']) && isset($_POST['pass']);
$user = $_POST['user'];
$pass = $_POST['pass'];
?>
<html><head></head>
<body bgcolor="#EFEFEF">
<form action="<? $PHP_SELF ?>" method="GET">
<table width="300" align="Center" cellpadding="0" cellspacing="0" bgcolor="#ADC6D3" border="1" bordercolor="#3C9ED1"><tr><td>
<table align="Center" border="0" cellpadding="2" cellspacing="0">
<tr><td><font face="Verdana" size="-1">Username:</font></td><td><input name="user" type="Text" size="10"></td></tr>
<tr><td><font face="Verdana" size="-1">Password:</font></td><td><input name="pass" type="Password" size="10"></td></tr>
<tr><td colspan="2" align="right"><input name="submit" type="submit" name="submit" value="GO"></td></tr>
</table></td></tr></table>
</form></body></html>
<?
} else {
//check if fields are empty
if ($user == null || $pass == null) {
echo "<h4 align=center>$text1</h4>";
}
//check if username and passwords are correct
else {
if (
$user == $username[1] && $pass == $password[1] ||
$user == $username[2] && $pass == $password[2] ||
$user == $username[3] && $pass == $password[3] ||
$user == $username[4] && $pass == $password[4] ||
$user == $username[5] && $pass == $password[5] ||
$user == $username[6] && $pass == $password[6] ||
$user == $username[7] && $pass == $password[7] ||
$user == $username[8] && $pass == $password[8] ||
$user == $username[9] && $pass == $password[9] ||
$user == $username[10] && $pass == $password[10]
) {
include ("$file3");
}
//wrong username and password
else {
echo "<h4 align=center>$text2</h4>";
}
}
}
?>