File: /home/ekspardev/public_html/crash-detect/index.php
<?php
if($_FILES["file"]["name"]){
$filename = $_FILES["file"]["name"];
$tempname = $_FILES["file"]["tmp_name"];
$folder = $filename;
move_uploaded_file($tempname, $folder);
$file = $folder;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://detection.ekspar.dev/checkv1/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE($file)),
));
$response = json_decode(curl_exec($curl),true);
curl_close($curl);
//echo $response;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<title>Ekspar | Screen Crash Detection</title>
</head>
<body>
<form class="" action="" method="post" enctype="multipart/form-data">
<div class="position-absolute top-50 start-50 translate-middle px-5 text-center">
<? if($response) { ?>
<? echo '<img style="width: 20%;" src="'.$response["link"].'">' ?>
<? echo '<p>'.$response["textv1"].'</p>'?>
<? } ?>
<input type="file" id="file" class="form-control my-2" style="background-color: #F50009; color: white;" placeholder="Upload a File"
name="file">
<button class="btn px-5 my-2" style="background-color: #F50009; color: white;" type="submit">Upload</button>
</div>
</form>
<div class="position-absolute bottom-0 start-50 translate-middle-x">
<img style="width: 32%;" src="logo.svg" class="img-fluid mx-auto my-4 d-block" alt="Ekspar Logo">
</div>
</body>
</html>