Show sourcecode
The following files exists in this folder. Click to view.
Webserver1/Ovningar/Slutprojekt/DEBUG/
callback_log.txt
ffmpeg_testing.php
force_verify_timeout.php
phpinfo.php
reset_session.php
test_callback_recieve.php
test_callback_send.php
test_dbmanager.php
test_upload.php
uploads/
test_callback_send.php
45 lines ASCII Windows (CRLF)
<?php
// show all error reporting
error_reporting(-1); // Report all type of errors
ini_set('display_errors', 1); // Display all errors
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
$callbackUrl = "http://localhost/Webserver1/Ovningar/Slutprojekt/DEBUG/test_callback_recieve.php";
// Dummy data
$payload = [
"media" => new CURLFile(
"C:/Users/antasp23/Documents/Webbutveckling/Webserver1/Ovningar/Slutprojekt/Media/Photos/placeholder.jpg",
"image/jpg"
),
"callback_url" => __FILE__
];
echo "<pre>";
print_r($payload);
echo "</pre>";
// Initiera cURL
$ch = curl_init($callbackUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Skicka POST
$response = curl_exec($ch);
if (!json_decode($response)) {
echo "<pre>";
print_r($response);
echo "</pre>";
} else {
echo "<p>Callback response: </p>";
echo "<pre>";
print_r(json_decode($response));
echo "</pre>";
}
?>