-
Notifications
You must be signed in to change notification settings - Fork 0
/
new.php
159 lines (152 loc) · 4.7 KB
/
new.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
$uname = $_POST['uname'];
$fullname = $_POST['fname'];
$pass = $_POST['pass'];
$email = $_POST['email'];
$bname = $_POST['bname'];
$conn = new mysqli("localhost","manras6_blog","manik3112","manras6_blog");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO manras6_blog.database values('".$uname."','".$pass."','".$email."','".$bname."','','".$fullname."')";
if ($conn->query($sql) === TRUE) {
echo '
<html>
<head>
<title>Blog in 20 seconds</title>
<meta name="description" content="Create a Text Blog in just 20 Seconds. Fastest text Blogging website. Write your memories in your own blog." />
<meta name="keywords" content="text blog ,fastest blog,create blog,write blog,blogging,writing,instant blog" />
<meta name="author" content="Manik Rastogi"
<meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="color.css">
<link rel="stylesheet" type="text/css" href="design.css">
</head>
<body>
<div class="main">
<table class="top"><center>
<tr>
<th><center>Congratulations</center></th>
<th style="border-left:solid #000 1px;"><center><a class="btn" href="login/">Login</a></center></th>
</tr>
</table>
<div class="banner">
BlogOff
</div>
<div class="content">
<div class="con">
<h4>blogoff.me/'.$uname.'</h4>
<h5>Login and Start Blogging</h5>
<a class="btn red" href="login/">Login</a>
</div>
</div>
<div class="footer">
© 2016-2017 BlogOff.me
</div>
</div>
</body>
</html> ';
} else {
echo '<html>
<head>
<title>Blog in 20 seconds</title>
<meta name="description" content="Create a Text Blog in just 20 Seconds. Fastest text Blogging website. Write your memories in your own blog." />
<meta name="keywords" content="text blog ,fastest blog,create blog,write blog,blogging,writing,instant blog" />
<meta name="author" content="Manik Rastogi"
<meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="color.css">
<link rel="stylesheet" type="text/css" href="design.css">
</head>
<body>
<div class="main">
<table class="top"><center>
<tr>
<th><center>oops</center></th>
<th style="border-left:solid #000 1px;"><center><a class="btn" href="login/">Login</a></center></th>
</tr>
</table>
<div class="banner">
BlogOff
</div>
<div class="content">
<div class="con">
<h5>It seems an error</h5><h4>Start Again</h4><h5>with different username</h5>
<a class="btn red" href="index.php">Home</a>
</div>
</div>
<div class="footer">
© 2016-2017 BlogOff.me
</div>
</div>
</body>
</html> ';
}
$conn->close();
?>
<?php
mkdir($uname);
$fname = $uname."/index.php";
$myfile = fopen($fname, "w") or die("Unable to open file!");
$txt = '<?php
$servername = "localhost";
$username = "manras6_blog";
$password = "manik3112";
$dbname = "manras6_blog";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
<?php
$sql = "SELECT * FROM data order by date desc";
$result = $conn->query($sql);
?>
<html>
<head>
<title>'.$fullname.' | Blog in 20 seconds</title>
<meta name="description" content="Create a Text Blog in just 20 Seconds. Fastest text Blogging website. Write your memories in your own blog." />
<meta name="keywords" content="text blog ,fastest blog,create blog,write blog,blogging,writing,instant blog" />
<meta name="author" content="Manik Rastogi"
<meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="..\design.css">
<link rel="stylesheet" type="text/css" href="..\color.css">
</head>
<body>
<div class="main">
<table class="top"><center>
<tr>
<th><center><?php date_default_timezone_set("Asia/Kolkata"); $date=date_create();date_modify($date,"0 min"); echo date_format($date,"D, d.M.Y h:i A"); ?></center></th>
<th style="border-left:solid #000 1px;"><center><a class="btn" href="..">Create</a></center></th>
</tr>
</table>
<div class="banner">
'.$bname.'
</div>
<div class="content">
<?php
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if($row["uname"]=="'.$uname.'"){
?>
<?php
echo "<div class=con><h4 class=lft>" . $row["head"]. "</h4><h5 class=rght>- " . $row["user"]. "</h5><hr><p>" . $row["data"]. "</p></div>";
}}
} else {
echo "0 results";
}
?>
</div>
<div class="footer">
© 2016-2017 BlogOff.me
</div>
</div>
</body>
</html>
<?php
$conn->close();
?>';
fwrite($myfile, $txt);
fclose($myfile);
?>