2021-08-11 04:39:38 +02:00
|
|
|
<?php
|
|
|
|
$headers = "From: support@qo-op.com"; // Who should it come from?
|
|
|
|
$to = "support@qo-op.com"; // Your email address
|
|
|
|
$subject = "Astroport qo-op BLOB";
|
|
|
|
|
2021-08-11 05:00:57 +02:00
|
|
|
$arguments = getopt("l:p:"); // php ajax.php -l "https://myserve.com/link.html"
|
2021-08-11 04:39:38 +02:00
|
|
|
if (isset($_REQUEST['link'])) $link = $_REQUEST['link']; else $link = urldecode($arguments['l']);
|
2021-08-11 05:00:57 +02:00
|
|
|
if (isset($_REQUEST['phone'])) $phone = $_REQUEST['phone']; else $phone = urldecode($arguments['p']);
|
2021-08-11 04:39:38 +02:00
|
|
|
|
2021-08-11 05:00:57 +02:00
|
|
|
$message = "Proposition de ". $phone ." message : ".$link;
|
2021-08-11 04:39:38 +02:00
|
|
|
|
2021-08-11 23:09:30 +02:00
|
|
|
//YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1);
|
2021-08-12 10:53:57 +02:00
|
|
|
$YOU=system("ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1'", $retval);
|
2021-08-11 23:09:30 +02:00
|
|
|
print_r($YOU);
|
2021-08-12 10:53:57 +02:00
|
|
|
print_r($retval);
|
2021-08-11 23:09:30 +02:00
|
|
|
|
2021-08-12 10:49:35 +02:00
|
|
|
$myfile = fopen("/home/".$YOU."/astroport/www/newfile.txt", "w") or die("Unable to open file!");
|
|
|
|
fwrite($myfile, $message);
|
2021-08-11 23:09:30 +02:00
|
|
|
fclose($myfile);
|
|
|
|
|
2021-08-11 05:30:02 +02:00
|
|
|
error_log("SEND ". $phone ." message : ".$link );
|
2021-08-11 04:39:38 +02:00
|
|
|
mail($to, $subject, $message, $headers);
|
|
|
|
echo "OK";
|
|
|
|
?>
|