-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostPaidAd.php
179 lines (140 loc) · 4.9 KB
/
postPaidAd.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
include_once 'db.php';
include_once 'advertisement.cls.php';
include_once 'image.cls.php';
if($_SERVER["REQUEST_METHOD"] == "POST")
{
if(!empty($_FILES['file']))
{
$fileType=$_FILES["file"]["type"];
$fileSize=$_FILES["file"]["size"];
$fileName=$_FILES["file"]["name"];
$fileErr=$_FILES["file"]["error"];
$fileTmp=$_FILES["file"]["tmp_name"];
if($fileErr==0)
{
move_uploaded_file($fileTmp, "image/".$fileName);
echo '<script language="javascript">';
echo 'alert("Ad posted!")';
echo '</script>';
}
}
}
if($_SERVER["REQUEST_METHOD"] == "POST")
{
header('location: paymentConfirmation.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>KIJIJI</title>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="#" crossorigin="anonymous">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.btn-gray{
background-color:#ccc;
background-image:-moz-linear-gradient(#f4f4f4,#bcbcbc);
background-image:-webkit-linear-gradient(#f4f4f4,#bcbcbc);
background-image:-ms-linear-gradient(#f4f4f4,#bcbcbc);
border-color:#aaa;
color:#000}
.btn-file{
position:relative
}
.btn-file input[type=file]{
position:absolute;
top:0;
right:0;
min-width:100%;
min-height:100%;
font-size:999px;
text-align:right;
filter:alpha(opacity=0);
opacity:0;
cursor:inherit;
display:block}input[readonly]{background-color:#fff!important;cursor:text!important}
.center {
margin: auto;
width: 40%;
border: 3px solid #D3D3D3;
padding: 20px;
</style>
</head>
<body onload="myFunction()">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="index.php">KIJIJI</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="index.php">Home <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
<br /><br /><br /><br />
<div class="center">
<form name="myForm" method="get" action="" enctype="multipart/form-data">
<h4>Paid Post(Add Pictures)</h4>
<label>Number of pictures :</label>
<select name="picNum">
<?php
for($i=1;$i<=10;$i++)
{
?>
<option value="<?php echo $i ?>"><?php echo $i; ?></option>
<?php
}
?>
</select>
<button class="btn btn-gray" type="submit" >OK</button>
</form>
<br />
<?php
if(isset($_GET['picNum']))
{
$imageNum=0;
$imageNum = $_GET['picNum'];
if($imageNum>=1)
{
for($j=0;$imageNum>$j;$j++)
{
echo"<input name='file' id='file' type='file' size=4 multiple><button type='button' >Upload</button>";
}
}
}
?>
<br /><br />
<form class="form-signin" method="post" action="#">
<button class="btn btn-gray" type="submit" >Payment</button>
</form>
</div>
<br />
</body>
</html>