<?php

/* Initialize an URL to the variable
$server = "http://logistics.martinhardware.rw";
  
// Use get_headers() function
$headers = @get_headers($server);
  
// Use condition to check the existence of URL
if($headers && strpos( $headers[0], '200')) {

// Data configuration for upload
$data=urlencode("12&34");
$comment="Upload from local to online";
$comment=urlencode($comment);
$data=array('Data'=>"$data",
'Comment'=>"$comment");
$param=json_encode($data);
$sub="api.php?Link=$param";
$result = file_get_contents("$server/$sub");
    $status = "URL Exist";
}
else {
    $status = "URL Doesn't Exist";
}
  
// Display result
echo($status);
*/

include'connection.php';
$json=$_GET['Link'];
$data = json_decode($json, true);
$insert=mysqli_query($conn, "INSERT INTO `mydata` (`Number`, `Data`, `Comment`) VALUES (NULL, '".$data['Data']."', '".$data['Comment']."')");
$display=urlencode("Successfull");
$info=array('Display'=>"$display");
$disp=json_encode($info);
?>





