-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdo.php
48 lines (36 loc) · 929 Bytes
/
do.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
<?php session_start();
if($_SESSION["key"]==1)
{
$newstitle=$_POST["title"];
$ncontent=$_POST["content"];
$ctag=$_POST["tag"];
$directory = "title/";
$filecount = 0;
$files = glob($directory . "*");
if ($files){
$filecount = count($files);
}
$filecount=$filecount++;
$handle1=fopen("title/".$filecount.".txt","w");
fwrite($handle1,$newstitle);
fclose($handle1);
$handle2=fopen("content/".$filecount.".txt","w");
fwrite($handle2,$ncontent);
fclose($handle2);
$handle3=fopen("tag/".$filecount.".txt","w");
fwrite($handle3,$ctag);
fclose($handle3);
$target_dir="images/";
$target_file=$target_dir.basename($_FILES["filetoupload"]["name"]);
$uploadOk=1;
$imageFileType=pathinfo($target_file,PATHINFO_EXTENSION);
$handle4=fopen("fc.txt","w");
fwrite($handle4,$filecount);
fclose($handle4);
header("Location:makepost.html");
}
else
{
header('Location:adminlogin.html');
}
?>