-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
134 lines (113 loc) · 5.52 KB
/
index.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
<?php require('connection.php');?>
<!Doctype HTML>
<html lang="en">
<head>
<title>Digital Assignment 3</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta property="og:title" content="Design Portfolio of Dilip Agarwal" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.dilipagarwal.com" />
<meta property="og:image" content="http://www.dilipagarwal.com/images/dilip.jpg" />
<meta property="og:image:width" content="590" />
<meta property="og:image:height" content="440" />
<meta property="og:site_name" content="Dilip Agarwal | Portfolio" />
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="twitter:widgets:csp" content="on">
<meta property='fb:app_id' content='381830641890866' />
<meta name="description" content="I am an enthusiastic and dedicated individual looking for an opportunity to work and explore the Information Technology sector and continuously seeking opportunity to implement my coding skills in solving real life problems." />
<meta name="robots" content="index,follow">
<link rel="canonical" href="https://www.dilipagarwal.com/" />
<meta property="og:description" content="I am an enthusiastic and dedicated individual looking for an opportunity to work and explore the Information Technology sector and continuously seeking opportunity to implement my coding skills in solving real life problems." />
<meta name="twitter:card" content="website" />
<meta name="twitter:description" content="Full Stack Programmer" />
<meta name="twitter:title" content="About Dilip Agarwal | UI/UX Designer & Front End Developer | Full Stack Programmer" />
<meta name="twitter:site" content="@dilipagarwal001" />
<meta name="twitter:creator" content="@dilipagarwal001" />
<meta name="twitter:image" content="http://www.dilipagarwal.com/images/dilip.jpg">
<meta name="keywords" content="Dilip Agarwal, vit university vellore, dilipagarwal001, github, work,, hackerrank, hackerearth, LinkedIn, contact, resume, website, portfolio, projects, skills, about, Bootstrap Portfolio , Dilip Agarwal Portfolio" />
<meta name="author" content="dilipagarwal001">
<meta name="email" content="contactdilipagarwal@gmail.com">
<meta name="copyright" content="Dilip Agarwal 2018" />
<meta property="og:description" content="I am an enthusiastic and dedicated individual looking for an opportunity to work and explore the Information Technology sector and continuously seeking opportunity to implement my coding skills in solving real life problems." />
<meta itemprop="name" content="Dilip Agarwal">
<meta itemprop="description" content="Full Stack Programmer.">
<meta itemprop="image" content="http://www.dilipagarwal.com/images/dilip.jpg">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<link href="css/style.css" rel="stylesheet"/>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<div class="container">
<div class="row text-center" style="">
<div class="col-lg-offset-3 col-lg-7" style="box-shadow: 0 3px 20px 0px rgba(0, 0, 0, 0.1);">
<h2 class="text-center" style="color:grey">Digital Assignment</h3>
<div class="row firstrow">
<div class="col-lg-5">
<input type="text" class="text-center" Placeholder="Enter Your Name" name="name" required />
</div>
<div class="col-lg-offset-2 col-lg-5 box">
<input type="email" class="text-center" placeholder="Enter Your Email" name="email" required />
</div>
</div>
<label for="file-upload" class="custom-file-upload">
<i class="fa fa-cloud-upload"></i> Upload Your File Here
</label>
<input id="file-upload" type="file" name="file" required />
<br>
<small style="color:grey"><span style="color:red">*</span> File Should be image or PDF</small>
<div class="submit">
<button type="submit" class="" name="submit">Submit</button>
<br>
<p id="message" style="font-weight:bold;font-size:15px;display:none;">File Uploaded Successfully... <u><a href="ShowFiles.php">Click Here view File.</a></u></p>
</div>
<div class="row text-right lead" style="padding-right:30px;color:darkgrey">
<div class="col-lg-12">
<p class="">Dilip Agarwal</p>
<p>--15BIT0309--</p>
</div>
</div>
</div>
</div>
</div>
</form>
<script></script>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$filename=$_FILES['file']['name'];
$tmp_name=$_FILES['file']['tmp_name'];
$filetype=$_FILES['file']['type'];
$filesize=$_FILES['file']['size']/1000;
$image=explode("/",$filetype)[0];
if($image=="image" || $filetype=="application/pdf")
{
if($filesize<500)
{
$query="insert into fileupload values('$name','$email','$filename','$filetype','$filesize')";
if(mysqli_query($con,$query))
{
move_uploaded_file($tmp_name,"files/".$filename);
echo "<script>
document.getElementById('message').style.display = ''
</script>";
}
}
else
{
echo "<script>alert('Please Upload File with less than 1MB')</script>";
}
}
else
{
echo "<script>alert('Please Upload Only Pdf or Image Files')</script>";
}
}
?>