astrXbian/www/boris/ajax.php

27 lines
1.0 KiB
PHP

<?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";
$arguments = getopt("l:p:"); // php ajax.php -l "https://myserve.com/link.html"
if (isset($_REQUEST['link'])) $link = $_REQUEST['link']; else $link = urldecode($arguments['l']);
if (isset($_REQUEST['phone'])) $phone = $_REQUEST['phone']; else $phone = urldecode($arguments['p']);
$message = "Proposition de ". $phone ." message : ".$link;
//YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1);
exec("ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1'", $YOU);
print_r($YOU);
$myfile = fopen("/home/fred/astroport/www/newfile.txt", "w") or die("Unable to open file!");
$txt = "John Doe\n";
fwrite($myfile, $txt);
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fclose($myfile);
error_log("SEND ". $phone ." message : ".$link );
mail($to, $subject, $message, $headers);
echo "OK";
?>