1 rizwank 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <title>SSP Admin :: Install</title>
6 <link rel="stylesheet" href="styles/main.css" />
7 </head>
8
9 <body>
10
11 <div id="container">
12 <h1>SSP Admin Install</h1>
13 <?php
14 require_once('./inc/connect.php');
15
16 $u = $_REQUEST['usr'];
17 $p = $_REQUEST['pwd'];
18
19 if (!$u){
20 $u = 'admin';
21 $p = substr(md5(uniqid(microtime())), 0, 6);
22 rizwank 1.1 }
23
24 // Create Tables
25
26 mysql_query("CREATE TABLE $atbl(id INT AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(100), description BLOB, path VARCHAR(50), tn TINYINT(1) NOT NULL DEFAULT '0', aTn VARCHAR(150), active TINYINT(1) NOT NULL DEFAULT '0', startHere TINYINT(1) NOT NULL DEFAULT '0', audioFile VARCHAR(100) DEFAULT NULL, audioCap VARCHAR(200) DEFAULT NULL, displayOrder TINYINT(4) DEFAULT '800', target TINYINT(1) NOT NULL DEFAULT '0')") or die("There was an error when writing to the DB:".mysql_error());
27
28 echo "<p>Albums Table Written Successfully...</p>";
29
30 flush();
31
32 mysql_query("CREATE TABLE $itbl(id INT AUTO_INCREMENT, PRIMARY KEY(id), aid INT, src VARCHAR(50), caption TEXT, link TEXT, active TINYINT(1) NOT NULL DEFAULT '1', seq TINYINT(4) DEFAULT NULL)") or die("There was an error when writing to the DB:".mysql_error());
33
34 echo "<p>Images Table Written Successfully...</p>";
35
36 flush();
37
38 mysql_query("CREATE TABLE $utbl(id INT AUTO_INCREMENT, PRIMARY KEY(id), usr VARCHAR(50), pwd VARCHAR(50), gName VARCHAR(200) DEFAULT NULL)") or die("There was an error when writing to the DB:".mysql_error());
39
40 echo "<p>Users Table Written Successfully...</p>";
41
42 mysql_query("CREATE TABLE $dtbl(id INT AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(100))") or die("There was an error when writing to the DB:".mysql_error());
43 rizwank 1.1
44 mysql_query("CREATE TABLE $dltbl(id INT AUTO_INCREMENT, PRIMARY KEY(id), did INT, aid INT, display TINYINT(4) DEFAULT '800')") or die("There was an error when writing to the DB:".mysql_error());
45
46 echo "<p>Dynamic Gallery Tables Written Successfully...</p>";
47
48
49 mysql_query("INSERT INTO $utbl (id, usr, pwd) VALUES (NULL, '$u', '$p')") or die("Error".mysql_error());
50
51 ?>
52
53 <p>Success! <a href="login-screen.php">Click here</a> to login for the first time with the username <strong><?php echo $u ?></strong> and the password <strong style="color:#fafafa;"><?php echo $p ?></strong>(Select the empty area to see your password. It is highly recommended that you now delete start.php, write.php and _install.php from your webserver.</p>
54
55 </div>
56 </body>
57 </html>
|