This repository was archived by the owner on May 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
93 lines (93 loc) · 2.82 KB
/
install.php
File metadata and controls
93 lines (93 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
error_reporting(0);
ob_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Installation | Linklisten Script</title>
<meta charset="ISO-8859-1">
<link rel="stylesheet" type="text/css" href="design/install.css">
</head>
<body>
<div id="logo"><img src="images/logo.png" alt=""></div>
<div id="seite">
<div class="title">Linkliste - Installation:</div>
<?php
switch($_GET["install"]){
case "":
?>
<div class="title2">(Schritt 1/2)</div><br>
<b>MySQL-Daten angeben:</b><br>
<form action="?install=1-2" method="post">
<table>
<tr><td>Host (oft: "localhost")</td><td><input type="text" name="host" value="localhost"></td></tr>
<tr><td>Datenbank-Name</td><td><input type="text" name="database"></td></tr>
<tr><td>Benutzername</td><td><input type="text" name="user"></td></tr>
<tr><td>Passwort</td><td><input type="password" name="pass"></td></tr>
<tr><td>Passwort (Wiederholung)</td><td><input type="password" name="pass2"></td></tr>
</table>
<input type="submit" value="Weiter">
</form>
<?php
break;
case "1-2":
?>
<div class="title2">(Schritt 1/2)</div><br>
<?php
if($_POST["pass"] != $_POST["pass2"])
{
echo "Die Passwörter stimmen nicht überein.<br><br>
<a href=\"?install=\">Zurück zu Schritt 1</a><br><br>";
}
else {
$fp = fopen("config.php","w+");
$HOST = '$HOST';
$USER = '$USER';
$PW = '$PW';
$DB = '$DB';
$DBTYPE = '$DBTYPE';
$daten = "<?php
$HOST = '$_POST[host]';
$USER = '$_POST[user]';
$PW = '$_POST[pass]';
$DB = '$_POST[database]';
$DBTYPE = 'mysql';
?>";
fwrite($fp,$daten);
include("config.php");
$dbc = new PDO('mysql:host='.$HOST.'', ''.$USER.'', ''.$PW.'');
$dbpre = $dbc->prepare("CREATE DATABASE IF NOT EXISTS ".$DB.";");
$dbpre->execute();
$dbc = new PDO(''.$DBTYPE.':host='.$HOST.';dbname='.$DB.'', ''.$USER.'', ''.$PW.'');
$dbpre = $dbc->prepare("CREATE TABLE IF NOT EXISTS wronnay_linkliste (
id INT(22) NOT NULL auto_increment,
titel varchar(220) NOT NULL,
link varchar(220) NOT NULL,
beschreibung text NOT NULL,
datum datetime NOT NULL,
PRIMARY KEY (id) );
");
$dbpre->execute();
header("Location: ?install=2");
}
break;
case "2":
?>
<div class="title2">(Schritt 2/2)</div><br>
<b>Die Installation ist fertig!:</b><br>
Wenn Sie noch Fragen, Probleme oder Wünsche haben oder wenn Sie einen Fehler gefunden haben, dann können Sie <a href="http://wronnayscripts.forenhosting.net/forum.php?id=3">hier</a> darüber diskutieren.
<br><br><a href="index.php">> OK!</a><br><br>
<?php
break;
}
?>
</div>
<div id="footer">
<div class="text">© <a href="http://scripts.wronnay.net">Scripts.Wronnay.net</a><br><br>
</div></div>
</body>
</html>
<?php
ob_end_flush();
?>