Nieuw lid |
|
cfg.php:
<?php
$db_host = "localhost";
$db_username = "root";
$db_password = "********";
$db_name = "sfb"; // wordt aangemaakt als nog niet bestaat
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mysql_connect($db_host, $db_username, $db_password);
if(!mysql_select_db($db_name))
{
mysql_query('CREATE DATABASE '.$db_name);
mysql_select_db($db_name);
}
?>
<?php $db_host = "localhost"; $db_username = "root"; $db_password = "********"; $db_name = "sfb"; // wordt aangemaakt als nog niet bestaat //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// { } ?>
install.php:
<?php
include('cfg.php');
// install.php
if (isset($_POST['install']))
{
$naam = $_POST['name'];
$password = $_POST['pass'];
$filedir = $_POST['dir'];
$file = $filedir.".sfb";
$hash = md5($naam).md5($password).1;
$query = "
CREATE TABLE `admin` (
adminID INT(10) AUTO_INCREMENT,
userID INT(10),
PRIMARY KEY(adminID)
) type=MyISAM;
CREATE TABLE `user` (
userID INT(10) AUTO_INCREMENT,
naam VARCHAR(100) NOT NULL,
password VARCHAR(100) NOT NULL,
file VARCHAR(100) NOT NULL,
PRIMARY KEY(userID)
) type=MyISAM;
INSERT INTO `user` (`naam`, `password`, `file`) VALUES ('".$naam."', '".$password."', '".$file."')
INSERT INTO `admin` (`userID`) VALUES (1)
";
mysql_query($query);
echo "gelukt verwijder dit bestand (over 5 seconde ga je naar de volgende pagina om je gegevens op te halen)";
sleep(5);
header("location:sfbfile.php?acc=".$hash);
}
else
{
?>Als cfg.php is ingevuld met kladblok vul in:<br>
<form action="" method="post">
Naam: <input type="text" name="name"><br>
Password: <input type="password" name="pass"><br>
dir: <input type="text" name="dir"><br>
<input type="submit" value="install" name="install">
</form><?php
}
?>
<?php include('cfg.php'); // install.php if (isset($_POST['install'])) { $naam = $_POST['name']; $password = $_POST['pass']; $filedir = $_POST['dir']; $file = $filedir.".sfb"; $hash = md5($naam).md5($password).1; $query = " CREATE TABLE `admin` ( adminID INT(10) AUTO_INCREMENT, userID INT(10), PRIMARY KEY(adminID) ) type=MyISAM; CREATE TABLE `user` ( userID INT(10) AUTO_INCREMENT, naam VARCHAR(100) NOT NULL, password VARCHAR(100) NOT NULL, file VARCHAR(100) NOT NULL, PRIMARY KEY(userID) ) type=MyISAM; INSERT INTO `user` (`naam`, `password`, `file`) VALUES ('".$naam."', '".$password."', '".$file."') INSERT INTO `admin` (`userID`) VALUES (1) "; echo "gelukt verwijder dit bestand (over 5 seconde ga je naar de volgende pagina om je gegevens op te halen)"; header("location:sfbfile.php?acc=".$hash); } else { ?>Als cfg.php is ingevuld met kladblok vul in:<br> <form action="" method="post"> Naam: <input type="text" name="name"><br> Password: <input type="password" name="pass"><br> dir: <input type="text" name="dir"><br> <input type="submit" value="install" name="install"> </form><?php } ?>
en zonder spatie is dit mijn error:
Parse error: syntax error, unexpected T_DNUMBER in E:\xampp server\xampp\htdocs\users\www\sfb\install.php on line 10
|