Server IP : 149.202.105.228 / Your IP : 216.73.216.18 Web Server : Apache System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : atfycaf ( 116275) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/atfycaf/www/pdf/ |
Upload File : |
<?php include "../globalVars.php"; if (isset($_GET["tournamentURL"])) { $groupURL = $_GET["groupURL"]; $tournamentURL = $_GET["tournamentURL"]; $knockoutTypeIDQuery = mysqli_query($conn, "SELECT id FROM knockoutGroups WHERE pageURL = '$groupURL'"); while ($kTQ = mysqli_fetch_array($knockoutTypeIDQuery)) { $knockoutTypeID = $kTQ["id"]; } $tournamentQuery = mysqli_query($conn, "SELECT id FROM knockoutConfig WHERE pageURL = '$tournamentURL' AND (tournType = '$knockoutTypeID')"); while ($tQ = mysqli_fetch_array($tournamentQuery)) { $tournamentID = $tQ["id"]; } $fixturesURL = $url . "pdf/tournament-fixtures-". $tournamentID .".html"; $localPDF = $_SERVER['DOCUMENT_ROOT'] . "/pdf/tournament-fixtures.pdf"; $PDFurl = "https://www.modsnetwebsitedesign.com/fab/tournamentCreate.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $PDFurl); curl_setopt($ch, CURLOPT_TIMEOUT, 90); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type:multipart/form-data" )); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'method' => "create", 'fixturesURL' => $fixturesURL )); curl_setopt($ch, CURLINFO_HEADER_OUT, true); $pdfResponse = curl_exec($ch); curl_close($ch); if($pdfResponse === false) { echo 'Curl error: ' . curl_error($ch); } else { $displayResponse = json_decode($pdfResponse, true); $fixturesPDFURL = $displayResponse["fixturesPDFURL"]; $getPDF = curl_init($fixturesPDFURL); $fp = fopen("$localPDF", "w"); curl_setopt($getPDF, CURLOPT_FILE, $fp); curl_setopt($getPDF, CURLOPT_HEADER, 0); curl_setopt($getPDF, CURLOPT_HTTPHEADER, Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15") ); curl_exec($getPDF); curl_close($getPDF); fclose($fp); if (file_exists($localPDF)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $PDFurl); curl_setopt($ch, CURLOPT_TIMEOUT, 90); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type:multipart/form-data" )); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'method' => "destroy" )); curl_setopt($ch, CURLINFO_HEADER_OUT, true); $pdfResponse = curl_exec($ch); curl_close($ch); } } $pdfFile = file_get_contents($localPDF); header('Content-type: application/pdf'); header('Content-Disposition: inline;'); echo $pdfFile; } ?>