· 10 years ago · Apr 17, 2016, 09:57 PM
1<?php
2//////////////////////////////////////////////////////
3//***************************************************/
4//* Code for ProgrammersHub Code for Love!! */
5//* This File is Written For SammyBOI */
6//* For Any Help, Contact me */
7//***************************************************/
8//* Email: mbosinwa@mbosinwa.me */
9//* Phone: 08163429760 */
10//* Website: http://www.mbosinwa.me */
11//* WebHost: http://www.hostmeout.com.ng */
12//////////////////////////////////////////////////////
13
14
15if(isset($_POST["submit"]))
16{
17
18$DBHOST = $_POST["server"];
19$DBUSER = $_POST["db_user"];
20$DBPASS = $_POST["db_pass"];
21$DBNAME = $_POST["dbname"];
22
23$db = new mysqli($DBHOST, $DBUSER, $DBPASS) or die("Could not connect to database... So sad ");
24if(!$db)
25die("no db");
26if(!mysqli_select_db($db, $DBNAME))
27{
28 $err_general_message = "Connection UnSuccessful.<br>
29 No database selected<br>";
30}
31else{
32 $general_message = "Connection Successful.<br>
33 MySqli Version: ".$db->get_server_info()."<br>";
34}
35//Table structure for table `rss_topics`
36$structure = "CREATE TABLE IF NOT EXISTS `rss_topics` (
37 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
38 `message` text COLLATE latin1_general_ci NOT NULL,
39 `subject` text COLLATE latin1_general_ci NOT NULL,
40 `poster` text COLLATE latin1_general_ci NOT NULL,
41 `rssurl` text COLLATE latin1_general_ci NOT NULL,
42 `date` int(11) NOT NULL,
43 PRIMARY KEY (`id`)
44) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;";
45
46$rss_topics_table = $db->query($structure);
47if ($rss_topics_table)
48{ $err_general_message = "Error occured wen creating table";
49}
50
51//Dumping data for table `rss_topics`
52$dump = "INSERT INTO `rss_topics` (`id`, `message`, `subject`, `poster`, `rssurl`, `date`) VALUES
53(1, 'TESTING RSS', 'FIRST RSS', 'SammyBOI', 'http://www.extrapulse.com/', 1345306363);";
54
55$insert_rss_topics = $db->query($dump);
56if($insert_rss_topics){
57$err_general_message = "Error Occured when installing RSS topic";
58}
59
60if ($rss_topics_table && $insert_rss_topics){
61 //echo "test";
62 $check = "SELECT * FROM rss_topics";
63 $query = $db->query($check);
64 $row = $query->fetch_row();
65 if ($row){
66 $suc_general_message = "[$row[1]] Installation Completed Successfully!! :)";
67 }
68
69}
70}
71
72?>
73
74
75<style type="text/css">
76 body, html, div, ul,li,a {margin:0; padding:0;}
77 body {font-family:arial;font-size:14px;color:#494949;background:#dbdbdb;}
78 .clear {clear:both;}
79 a img {border:none;}
80 h1 {color:#111731;display:inline;}
81 #content {width:600px; margin:0 auto;background:#fff;border:1px solid #a2a2a2;margin-top:5px;margin-bottom:20px;}
82 #logo {width:600px; margin:0 auto; margin-top:10px; }
83 #logo img {vertical-align:middle;}
84
85 #form {width:400px; margin:0 auto;padding:10px;}
86 #form label {display:block; width:150px;float:left;margin:13px 0;}
87 #form .textbox {border:1px solid #ccc;padding:5px; margin:10px 0 10px 20px;color:#494949}
88
89 p.err {padding-left:170px; color:#aa1b1b;}
90 p.general_err {text-align:center; background:#aa1b1b;color:#fff;padding:10px;}
91 p.general_msg {text-align:center; background:#208668;color:#fff;padding:10px;margin:10px;}
92 p.general_suc {text-align:center; background:#208118;color:#fff;padding:10px;margin:10px;}
93</style>
94
95 <div id="content">
96 <img id="logo" src="http://www.extrapulse.com/wp-content/uploads/2015/12/img20151212_202545.png"/>
97<h1>Installation compatibility</h1>
98<p><b><font color = 'blue'>Before proceeding with the full installation Of My RSS Feed, Ensure that the tests on the server configuration was passed.</font></b><br />
99
100<table width="100%" border="1" id="form" style="border-collapse:collapse;">
101 <tr>
102 <td width="44%"> PHP version >=5.0</td>
103 <td width="56%"><?php if (strnatcmp(phpversion(),'5.0.0') >= 0)
104 {
105 echo "<font color='green'> Yes ". phpversion(). "</font>";
106 $phpver=1;
107 }
108 else
109 {
110 echo "<font color='#FF0000'> No</font>";
111 $phpver=0;
112 }
113 ?></td>
114 </tr>
115 <tr>
116 <td> MySQLi</td>
117 <td> <?php if(@mysqli_connect()) { echo "<font color='green'> On</font>"; $mysql=1; } else { echo "<font color='red'> Off</font>"; $mysql=0; } ?></td>
118 </tr>
119
120 <?php
121if($phpver and $mysql)
122{
123?>
124<tr>
125 <td colspan="2" align="center">
126<input type="button" class="button" name="start" value="Next" onClick="parent.location='install.php?start'">
127</td></tr>
128<?php } else {
129 echo "<font size='+3' color='#FF0000'>Please check the following error.</font>";
130 }
131 ?>
132
133</table>
134<h1> </h1>
135<span style="text-align:justify;"> </span>
136
137
138<?php
139if(isset($_GET["start"])) {
140 //$domain = $_SERVER['HTTP_HOST'];
141 //$domain = "www.extrapulse.com";
142 if(empty($suc_general_message)){
143?>
144
145<h1>DataBase & Site Configuration</h1>
146
147<center>
148 <?php if(isset($err_general_message) && $err_general_message != ''){ ?>
149 <p class="general_err"><?php echo $err_general_message; ?></p>
150 <?php } ?>
151
152 <?php if(isset($general_message) && $general_message != ''){ ?>
153 <p class="general_msg"><?php echo $general_message; ?></p>
154 <?php } ?>
155</center>
156
157<p>Be careful & check twice before proceed</p>
158<br>
159<form id="form" name="database" action="" method="post">
160<table width="100%" border="1" style="border-collapse:collapse;">
161 <tr>
162 <td width="44%">DataBase Server</td>
163 <td width="56%">
164 <input type="text" name="server" class="textbox" value="localhost" />
165 <small>DataBase Server is required.</small></td>
166 </tr>
167 <tr>
168 <td>DataBase Name</td>
169 <td>
170 <input type="text" name="dbname" class="textbox" />
171 <small>DataBase Name is required.</small></td>
172 </tr>
173 <tr>
174 <td>DataBase Username</td>
175 <td>
176 <input type="text" name="db_user" class="textbox" />
177 <small">DataBase Username is required.</small></td>
178 </tr>
179 <tr>
180 <td>DataBase Password</td>
181 <td><input type="text" name="db_pass" class="textbox"></td>
182 </tr>
183
184 <tr>
185 <td colspan="2" align="center">
186 <input type="submit" name="submit" value="Install" class="button"></td>
187 </tr>
188</table>
189</form>
190 <?
191 }
192 ?>
193<h1> </h1>
194<span style="text-align:justify;"> </span>
195<p align="center">
196</p>
197<?
198if(isset($suc_general_message) && $suc_general_message != ''){ ?>
199 <p class="general_suc"><?php echo $suc_general_message; ?></p>
200 <?php
201 }
202}
203?>