-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
55 lines (45 loc) · 1.76 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
<?php
//import the converter class
require('image_converter.php');
if ($_FILES) {
$obj = new Image_converter();
//call upload function and send the $_FILES, target folder and input name
$upload = $obj->upload_image($_FILES, 'uploads', 'fileToUpload');
if ($upload) {
$imageName = urlencode($upload[0]);
$imageType = urlencode($upload[1]);
if ($imageType == 'jpeg') {
$imageType = 'jpg';
}
header('Location: convert.php?imageName=' . $imageName . '&imageType=' . $imageType);
}
}
?>
<?php include("includes/header.php"); ?>
<div class="container pb-4">
<div class="row">
<div class="col col-lg-12 col-md-12 col-sm-12">
<h1 class="text-center h2 fw-bold">Image Converter</h1>
<h2 class="text-center h4">Convert Any image to JPG, PNG, GIF</h2>
<br>
<div class="card text-center mx-auto p-2 gradient-card">
<!-- <img src="..." class="card-img-top" alt="..."> -->
<div class="card-body">
<h4 class="card-title h4 fw-bold">Upload and Convert Image of your choice</h4>
<p class="card-text">JPG to PNG | JPG to GIF | PNG to JPG | PNG to GIF | GIF to JPG | GIF to PNG | JPEG to PNG | JPEG to GIF</p>
</div>
<div class="card-body">
<form action="" enctype="multipart/form-data" method="post" onsubmit="return checkEmpty()">
<div class="mb-3">
<label for="fileToUpload" class="form-label">Upload file</label>
<input type="file" class="form-control" name="fileToUpload" id="fileToUpload">
</div>
<button type="submit" class="btn btn-warning btn-lg fw-bold"><i class="fa-solid fa-upload"></i> Upload</button>
</form>
</div>
</div>
</div>
</div>
<?php include_once("includes/social_link.php"); ?>
</div>
<?php include("includes/footer.php"); ?>