0) { $isgif = true; } //$pngext = 'gif';
} else if (isset($_POST['isgif'])) {
if (strlen($_POST['isgif']) > 0) { $isgif = true; } //$pngext = 'gif';
}
}
if (isset($_POST['tdsubj']) || isset($_GET['tdsubj'])) {
if (isset($_GET['tdsubj'])) {
$psubject = explode("~", str_replace("+"," ",urldecode($_GET['tdsubj'])))[0];
if (strpos(str_replace("+"," ",urldecode($_GET['tdsubj'])),"~") !== false) {
$gmtblurb = explode("~", str_replace("+"," ",urldecode($_GET['tdsubj'])))[1];
}
} else {
$psubject = explode("~", str_replace("+"," ",urldecode($_POST['tdsubj'])))[0];
if (strpos(str_replace("+"," ",urldecode($_POST['tdsubj'])),"~") !== false) {
$gmtblurb = explode("~", str_replace("+"," ",urldecode($_POST['tdsubj'])))[1];
}
}
}
if (isset($_POST['mysubject']) && isset($_POST['myfname'])) {
if (strpos($_POST['mysubject'], ' via ') !== false && strpos(($_POST['mysubject'] . ''), 'animated_gif_slideshow.gif') !== false) {
sleep(9);
if (file_exists('../PHP/animegif/' . server_remote_addr() . '.gif')) {
$altmydurl = @file_get_contents('../PHP/animegif/' . server_remote_addr() . '.gif');
$postsubjs = explode(' via ', $_POST['mysubject']);
$postsubj = str_replace(' via ' . $postsubjs[-1 + sizeof($postsubjs)], '', $_POST['mysubject']);
$postfname = $_POST['myfname'];
if (strpos($_POST['myfname'], '.' . $pngext) !== false) {
$postfname = str_replace('.' . $pngext, '.gif', $_POST['myfname']);
} else {
$postfname = $_POST['myfname'];
}
$pngext = 'gif';
} else {
$postsubjs = explode(' via ', $_POST['mysubject']);
$postsubj = str_replace(' via ' . $postsubjs[-1 + sizeof($postsubjs)], '', $_POST['mysubject']);
$postfname = $_POST['myfname'];
}
} else {
$postsubj = $_POST['mysubject'];
$postfname = $_POST['myfname'];
}
} else if (isset($_GET['mysubject']) && isset($_GET['myfname'])) {
if (strpos($_GET['mysubject'], ' via ') !== false && strpos(($_GET['mysubject'] . ''), 'animated_gif_slideshow.gif') !== false) {
sleep(9);
if (file_exists('../PHP/animegif/' . server_remote_addr() . '.gif')) {
$altmydurl = @file_get_contents('../PHP/animegif/' . server_remote_addr() . '.gif');
$postsubjs = explode(' via ', $_GET['mysubject']);
$postsubj = str_replace(' via ' . $postsubjs[-1 + sizeof($postsubjs)], '', $_GET['mysubject']);
$postfname = $_GET['myfname'];
if (strpos($_GET['myfname'], '.' . $pngext) !== false) {
$postfname = str_replace('.' . $pngext, '.gif', $_GET['myfname']);
} else {
$postfname = $_GET['myfname'];
}
$pngext = 'gif';
} else {
$postsubjs = explode(' via ', $_GET['mysubject']);
$postsubj = str_replace(' via ' . $postsubjs[-1 + sizeof($postsubjs)], '', $_GET['mysubject']);
$postfname = $_GET['myfname'];
}
} else {
$postsubj = $_GET['mysubject'];
$postfname = $_GET['myfname'];
}
}
function server_remote_addr() {
$rma = $_SERVER['REMOTE_ADDR'];
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
return $rma;
}
function ourpremail($ris, $ssis, $tis, $his) {
global $okay, $atendis, $idata, $pngext, $postfname, $postfname, $altmydurl;
$imdata = "";
$otherccs="";
$xris=""; //$ris;
$spareris="";
$toaststyling=" ";
$xxris=explode(",", $ris);
for ($iy=0; $iy" . $xxris[$iy] . "";
}
if (isset($_GET['cc'])) {
$xxris=explode(",", urldecode($_GET['cc']));
$spareris="";
for ($iy=0; $iy" . $xxris[$iy] . "";
}
if ($_GET['cc'] != "") $otherccs.="
CC: " . $spareris;
} else if (isset($_POST['cc'])) {
$xxris=explode(",", urldecode($_POST['cc']));
$spareris="";
for ($iy=0; $iy" . $xxris[$iy] . "";
}
if ($_POST['cc'] != "") $otherccs.="
CC: " . $spareris;
}
if (isset($_GET['bcc'])) {
$xxris=explode(",", urldecode($_GET['bcc']));
$spareris="";
for ($iy=0; $iy" . $xxris[$iy] . "";
}
if ($_GET['bcc'] != "") $otherccs.="
BCC: " . $spareris;
} else if (isset($_POST['bcc'])) {
$xxris=explode(",", urldecode($_POST['bcc']));
$spareris="";
for ($iy=0; $iy" . $xxris[$iy] . "";
}
if ($_POST['bcc'] != "") $otherccs.="
BCC: " . $spareris;
}
$hgt="200";
$xsis = $ssis;
$altwin='';
if (1 == 1 && $idata != "") {
if ($altmydurl != '') {
$imdata="";
} else {
$imdata="";
}
$hgt="480";
}
try {
//file_put_contents("aaaaa.00aaa", $ris . " " . $xsis);
//mail("rmetcalfe15@gmail.com", $xsis, "My Body", $his);
mail($ris, $xsis, $tis, $his);
$altwin = "" . $toaststyling . "Email sent successfully
To: " . $xris . $otherccs . "
Subject: " . $ssis . "
" . $imdata . "
'); setTimeout(andthenx,7000); \">";
} catch (Exception $merr) {
$okay = 0;
if (file_exists(dirname(__FILE__) . "/mail.prob")) {
file_put_contents(dirname(__FILE__) . "/mail.prob", file_get_contents(dirname(__FILE__) . "/mail.prob") . "\n\n" . date('l jS \of F Y h:i:s A') . " ... " . $merr->getMessage());
$altwin = "" . $merr->getMessage() . " sending to
" . $ris . $otherccs . "
'); setTimeout(andthenx,7000); \">";
} else {
file_put_contents(dirname(__FILE__) . "/mail.prob", date('l jS \of F Y h:i:s A') . " ... " . $merr->getMessage());
$altwin = "" . $merr->getMessage() . " sending to
" . $ris . $otherccs . "'); setTimeout(andthenx,7000); \">";
}
}
if ($atendis != "") {
echo $atendis;
$atendis='';
exit;
} else if ($altwin != "") {
echo $altwin;
$altwin='';
exit;
}
}
function issetgetaudiodata($which) {
global $bigbits;
if (isset($_POST[$which])) {
return true;
} else if (sizeof($bigbits) == 2) {
if (strpos($bigbits[0], $which . "=") !== false) {
return true;
}
}
return false;
}
function getaudiodata($which) {
global $bigbits;
if (isset($_POST[$which])) {
return $_POST[$which];
} else if (sizeof($bigbits) == 2) {
if (strpos($bigbits[0], $which . "=") !== false) {
$xxx=explode($which . "=", $bigbits[0]);
$yyy=explode("&", $xxx[1]);
return $yyy[0];
}
}
return "";
}
function send_email($tem, $mysubject, $mybody) {
global $idata, $bigbits, $atendis, $pngext, $postfname, $postfname, $altmydurl, $isgif, $psubject, $gmtblurb;
if ($psubject != "") { $mysubject=$psubject; }
$aext = ".wav";
$cno = 0;
$mobilewav = "";
$pref="";
$defone = ""; //"Please see or download image (first) before any download and double clicking of image clickable and applicable web application below:";
$eol = PHP_EOL;
if (issetgetaudiodata('mapclick1') && issetgetaudiodata('mapcoords1') && issetgetaudiodata('mapaudio1')) {
if (urldecode(getaudiodata('mapcoords1')) != "") {
$cfound = 0;
$cno = 1;
while ((issetgetaudiodata('mapclick' . $cno) || issetgetaudiodata('mapaudio' . $cno)) && issetgetaudiodata('mapcoords' . $cno)) {
if (issetgetaudiodata('mapclick' . $cno)) {
if (urldecode(getaudiodata('mapclick' . $cno)) != "" && urldecode(getaudiodata('mapcoords' . $cno)) != "") {
$cfound = 1;
if ($defone == "") {
$defone = $pref . "Please see or download image (first) before any download and double clicking of image clickable and applicable web application below ... please note mobile web email clients are preferred to mobile email clients:";
} else if (strpos($defone, " audio") !== false) {
$defone = $pref . "Please see or download image (first) and audios (second) before any download and double clicking of image clickable and applicable web application below ... please note mobile web email clients are preferred to mobile email clients:";
} else {
$defone = $pref . "Please see or download image (first) before any download and double clicking of image clickable and applicable web application below ... please note mobile web email clients are preferred to mobile email clients:";
}
}
}
if (issetgetaudiodata('mapaudio' . $cno)) {
if (urldecode(getaudiodata('mapaudio' . $cno)) != "" && urldecode(getaudiodata('mapcoords' . $cno)) != "") {
$cfound = 1;
if ($defone == "") {
$defone = $pref . "Please see or download audio (first) before any download and double clicking of image clickable and applicable web application below ... please note mobile web email clients are preferred to mobile email clients:";
} else if (strpos($defone, "download image") !== false) {
$defone = $pref . "Please see or download image (first) and audios (second) before any download and double clicking of image clickable and applicable web application below ... please note mobile web email clients are preferred to mobile email clients:";
} else {
$defone = $pref . "Please see or download audios (first) before any download and double clicking of image clickable and applicable web application below ... please note mobile web email clients are preferred to mobile email clients:";
}
}
} else if (sizeof($bigbits) == 2) {
if (strpos($bigbits[0], "mapaudio") !== false) {
$pref = ""; //"huh ";
$defone = $pref . $defone;
}
}
$cno++;
}
$cno = $cfound;
}
} else if (issetgetaudiodata('mapclick1') && issetgetaudiodata('mapcoords1')) {
//if (urldecode(getaudiodata('mapclick1') != "" && urldecode(getaudiodata('mapcoords1') != "") {
if (urldecode(getaudiodata('mapcoords1')) != "") {
$cfound = 0;
$cno = 1;
while (issetgetaudiodata('mapclick' . $cno) && issetgetaudiodata('mapcoords' . $cno)) {
if (urldecode(getaudiodata('mapclick' . $cno)) != "" && urldecode(getaudiodata('mapcoords' . $cno)) != "") {
$cfound = 1;
}
$cno++;
}
$cno = $cfound;
}
}
if (strpos($tem, ",") !== false) {
$hs = explode(",", $tem);
for ($ihs=0; $ihs ";
$ais="audio";
$bigais="";
if (issetgetaudiodata('maptype' . $cno)) {
if (str_replace("img","",urldecode(getaudiodata('maptype' . $cno))) != "") {
$bigais=urldecode(getaudiodata('maptype' . $cno));
$bs=explode("/",$bigais);
$ais=$bs[0];
} else {
$bigais=$ais . '/' . strtolower(str_replace(".","",$aext));
}
}
$mobilewav .= "<" . $ais . " id='au" . $cno . "' controls='controls' autobuffer='autobuffer'> ";
if (strpos(urldecode(getaudiodata('mapaudio' . $cno)), ";base64,") !== false) {
if (strpos(urldecode(getaudiodata('mapaudio' . $cno)), "data:;base64,") !== false) {
$mobilewav .= ' ';
} else {
$mobilewav .= ' ';
}
} else {
$mobilewav .= ' ';
}
$mobilewav .= "" . $ais . "> ";
$mobilewav .= "
";
$content = chunk_split(getaudiodata('mapaudio' . $cno));
$fwav=$befdots[0] . "_" . $cno . $aext; //".wav";
$headers .= "Content-Type: application/octet-stream; name=\"" . $fwav . "\"" . $eol;
$headers .= "Content-Transfer-Encoding: base64" . $eol;
$headers .= "Content-Disposition: attachment;filename=\"" . $fwav . "\"" . $eol;
$headers .= $content . $eol . $eol;
$headers .= "--" . $separator . $eol; //"--";
}
$cno++;
}
$cno = $origcno;
$somehtml = '';
$somehtml .= '';
$somehtml .= '';
$somehtml .= 'Web Application for Clickable ' . $filename . '';
$somehtml .= '';
//$somehtml .= '';
$somehtml .= '';
$somehtml .= '';
$somehtml .= '';
$somehtml .= '';
if (issetgetaudiodata('mapclick1') && issetgetaudiodata('mapcoords1') && issetgetaudiodata('mapaudio1')) {
while (issetgetaudiodata('mapclick' . $cno) && issetgetaudiodata('mapcoords' . $cno) && issetgetaudiodata('mapaudio' . $cno)) {
if (urldecode(getaudiodata('mapclick' . $cno)) != "" && urldecode(getaudiodata('mapaudio' . $cno)) == "" && urldecode(getaudiodata('mapcoords' . $cno)) != "") {
$somehtml = str_replace('' . '' . '' . '' . '", $mobilewav . "", $somehtml))));
$filename="mobile_" . $befdots[0] . ".htm";
$headers .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"" . $eol;
$headers .= "Content-Transfer-Encoding: base64" . $eol;
$headers .= "Content-Disposition: attachment;filename=\"" . $filename . "\"" . $eol;
$headers .= $content . $eol . $eol;
}
$headers .= "--" . $separator . "--";
}
//file_put_contents("aaa.aaa", $filename);
ourpremail($tem, $mysubject, "", $headers);
}
}
if ($contents == '') { // on fail
//file_put_contents("aaa.aaa", "fail");
ourpremail($tem, $mysubject, $mybody, $headers);
}
}
return "";
}
if (isset($_GET['lookfor'])) { // audio content
if (strpos($_SERVER['HTTP_REFERER'], "rjmprogramming.com.au") !== false) {
while (!file_exists("../MarkItUp/html/audio/audio" . $_GET['lookfor'] . "_" . str_replace(":","",str_replace(".","",server_remote_addr())) . ".wav")) {
sleep(5);
}
//sleep(2);
$audioc = file_get_contents("../MarkItUp/html/audio/audio" . $_GET['lookfor'] . "_" . str_replace(":","",str_replace(".","",server_remote_addr())) . ".wav");
unlink("../MarkItUp/html/audio/audio" . $_GET['lookfor'] . "_" . str_replace(":","",str_replace(".","",server_remote_addr())) . ".wav");
echo " parent.document.getElementById('mapaudio" . $_GET['lookfor'] . "').value='" . base64_encode($audioc) . "'; parent.document.getElementById('mapxaudio" . $_GET['lookfor'] . "').value='" . base64_encode($audioc) . "'; ";
}
exit;
} else { // email work
if ($altmydurl != "") {
$mydurl = $altmydurl;
$idata = $mydurl;
} else {
$bigbits = explode("mydurl=", file_get_contents('php://input'));
if (sizeof($bigbits) == 2) {
//if (strlen($bigbits[1]) < 35) {
// sleep(13);
// $bigbits = explode("&mydurl=", file_get_contents('php://input'));
//}
//$putfp = fopen('php://input', 'r');
//$putdata = '';
//while ($data = fread($putfp, 1024)) {
// $putdata .= $data;
//}
//fclose($putfp);
//$bigbits[1]=$putdata;
$mydurl = urldecode($bigbits[1]);
//file_put_contents("aaaaa.aaaaa", $mydurl);
if (isset($_POST['mydurl'])) {
if (strlen(urldecode($_POST['mydurl'])) > strlen($mydurl)) {
$mydurl=urldecode($_POST['mydurl']);
}
}
$idata = base64_decode(explode("&from=",$mydurl)[0]);
}
}
if (isset($_GET['mode']) || isset($_POST['mode']) || isset($_POST['ismobile'])) {
//file_put_contents("aaa.aaa", "a.a");
if (isset($_POST['ismobile'])) {
$gmode .= " ";
$ismobile = $_POST['ismobile'];
if (!isset($_POST['mydurl']) && $mydurl == '') { // && isset($_POST['myfname'])) {
if ($altmydurl != "") {
$mydurl = $altmydurl;
$idata = $mydurl;
} else {
$bigbits = explode("mydurl=", file_get_contents('php://input'));
if (sizeof($bigbits) == 2) {
$mydurl = urldecode($bigbits[1]);
//file_put_contents("aaaa.aaaa", $mydurl);
if (isset($_POST['mydurl'])) {
if (strlen(urldecode($_POST['mydurl'])) > strlen($mydurl)) {
$mydurl=urldecode($_POST['mydurl']);
}
}
$idata = base64_decode(explode("&from=",$mydurl)[0]);
}
}
}
}
if (isset($_GET['mode'])) $gmode .= $_GET['mode'];
if (isset($_POST['mode'])) $gmode .= $_POST['mode'];
//file_put_contents("aaaaa.0aaa", $lworld . " " . $postfname);
if (strlen(str_replace("*feedback_", "", ("*" . $postfname))) != strlen(("*" . $postfname))) {
$tem = urldecode($_POST['to']);
//file_put_contents("aaaaa.02aaa", $lworld . " " . $postfname);
if (strlen(str_replace("." . $pngext . "*", "", ($postfname . "*"))) != strlen(($postfname . "*")) && strlen(str_replace("*" . $lworld . "_", "", ("*" . $postfname))) != strlen(("*" . $postfname))) {
//file_put_contents("aaaaa.002aaa", $lworld . " " . $postfname);
//file_put_contents("aaa.aaa", "aaa.aaa");
if ($mydurl != '') {
$idata = base64_decode(explode("&from=",$mydurl)[0]);
//file_put_contents(urldecode($postfname), explode("&from=",$mydurl)[0]);
if (isset($_GET['showimage']) || isset($_POST['showimage'])) {
if ($altmydurl != "") {
$atendis="'; \">";
} else {
$atendis="'; \">";
}
}
} else {
$idata = base64_decode(explode("&from=",urldecode($_POST['mydurl']))[0]);
//file_put_contents(urldecode($postfname), explode("&from=",($_POST['mydurl']))[0]);
if (isset($_GET['showimage']) || isset($_POST['showimage'])) {
if ($altmydurl != "") {
$atendis="'; \">";
} else {
$atendis="'; \">";
}
}
}
// //file_put_contents($postfname, $idata);
//file_put_contents(urldecode($postfname), $idata);
//file_put_contents("aaa.aaa", "");
$mysubject = $postsubj;
//file_put_contents("aaa.aaa", urldecode($mysubject));
$mybody = $postfname;
//file_put_contents("aaa.aaa", $_SERVER['REMOTE_ADDR']);
send_email($tem, urldecode($mysubject), urldecode($mybody));
}
} else if ($gmode != '' && $ismobile == '' && (isset($_POST['mydurl']) || $mydurl != '') && isset($_POST['myfname'])) {
//file_put_contents("aaa.aaa", "aa.aa");
//$tem = urldecode($_POST['to']);
//file_put_contents("aaaaa.1aaa", $lworld . " " . $postfname);
if (strlen(str_replace("." . $pngext . "*", "", ($postfname . "*"))) != strlen(($postfname . "*")) && strlen(str_replace("*" . $lworld . "_", "", ("*" . $postfname))) != strlen(("*" . $postfname))) {
if ($altmydurl != '') {
$idata = $altmydurl; //base64_decode(explode("&from=",$altmydurl)[0]);
} else if ($mydurl != '') {
$idata = base64_decode(explode("&from=",$mydurl)[0]);
} else {
$idata = base64_decode(explode("&from=",urldecode($_POST['mydurl']))[0]);
}
file_put_contents($postfname, $idata);
}
} else if ($ismobile != '' && (isset($_POST['mydurl']) || $mydurl != '') && isset($_POST['myfname']) && isset($_POST['to'])) {
//file_put_contents("aaa.aaa", "aaa.aa");
$tem = urldecode($_POST['to']);
//file_put_contents("aaaaa.02aaa", $lworld . " " . $postfname);
if (strlen(str_replace("." . $pngext . "*", "", ($postfname . "*"))) != strlen(($postfname . "*")) && strlen(str_replace("*" . $lworld . "_", "", ("*" . $postfname))) != strlen(("*" . $postfname))) {
//file_put_contents("aaaaa.002aaa", $lworld . " " . $postfname);
//file_put_contents("aaa.aaa", "aaa.aaa");
if ($altmydurl != '') {
$idata = $altmydurl; //base64_decode(explode("&from=",$altmydurl)[0]);
} else if ($mydurl != '') {
$idata = base64_decode(explode("&from=",$mydurl)[0]);
} else {
$idata = base64_decode(explode("&from=",urldecode($_POST['mydurl']))[0]);
}
//file_put_contents($postfname, $idata);
//file_put_contents("aaa.aaa", "");
$mysubject = $postsubj;
//file_put_contents("aaa.aaa", urldecode($mysubject));
$mybody = $postfname;
//file_put_contents("aaa.aaa", $_SERVER['REMOTE_ADDR']);
send_email($tem, urldecode($mysubject), urldecode($mybody));
if ($okay == 0) {
echo " parent.document.getElementById('estatus').style.color='red'; parent.document.getElementById('estatus').innerHTML=' X '; ";
} else {
echo " parent.document.getElementById('estatus').style.color='green'; parent.document.getElementById('estatus').innerHTML=' ✓ '; ";
}
}
}
}
}
?>