forked from martin7jd/wpshepherd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inst_one.php
executable file
·61 lines (41 loc) · 1.89 KB
/
inst_one.php
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
<?php
# Download wordpress latestzip to /htdocs/...
# Link URL http://wordpress.org/latest.zip
#
# Form to enter the website name that is to be used
# This page gathers the information together to install a version of wordpress
# as a localhost copy.
# Admin_main is set-up first so that the installation of each copy can take place.
# It follows the "Famouse 5-Minute Install"
require_once('./common/con_localhost.php');
$link = local_db_connect();
$lh_port = $_SERVER["HTTP_HOST"];
# Global information
$web = $_POST['web'];
# Check to see if there is a directory call wordpress_****** and ask if it wants to be deleted
if (file_exists('../wordpress_' . $web)) {
echo '<div>';
echo 'The directory wordpress_' . $web . ' exists<br/>';
echo '</div>';
}
# Delete the progress.txt file
if(file_exists('progress.txt')){
unlink('progress.txt');
}
# Make foo the current db
$db_selected = mysqli_select_db($link, $web);
echo '<div id="sitename">';
if ($db_selected) {
echo '<h3>Warning</h3>';
echo 'A database with that name already exists<br/>';
echo 'By clicking on Continue it will delete the existing installation<br/>and do you a fresh install<br/>';
} else {
echo '<h3>Congratulations</h3>';
echo 'There are no Wordpress websites on ' . $lh_port . ' with the name<br/><h3>"' . $web . '"</h3>';
}
# Confirmation that they wish to proceed and overwrite the folder and database
echo '<br/><button type="button" onclick="inst_confirm();inst_cont(\'' . $web . '\', \'' . $lh_port . '\')">Continue?</button> <button type="button" onclick="inst_deny()">Cancel!</button>';
echo '</div>';
# Close db connection
mysqli_close($link);
?>