$val) { if (!$pdf) $pdf = new PDF_Attachment(); //if (strpos(htmlspecialchars($val), ".php") === false) { if ($val != "" && substr(strtolower($name),0,7) == "subject") { if (strtolower($name) == "subject") { $httpc=""; short($val); if ($httpc != "") { $msg=$httpc; } else { $msg=urldecode($val); } } else { $msgn=str_replace("_",".",urldecode($name)); $msgv=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); } } else if ($val == "" && substr(strtolower($name),0,7) == "subject") { $msg=$msg; } else if ($val == "" && file_exists($name)) { $pdf->Attach(getcwd() . "/" . $name); $done=true; $cnt++; } else if ($val == "" && !file_exists(short($name))) { file_put_contents(short($name), ""); $pdf->Attach(getcwd() . "/" . short($name)); $flist.=$fdelim . (short($name)); $fdelim=','; $done=true; $cnt++; } else if ($val != "" && file_exists($name)) { $pref="1_"; while (file_exists($pref . short($name))) { $pref.="1_"; } file_put_contents($pref . short($name), ourhtmlspecialchars($val)); $pdf->Attach(getcwd() . "/" . $pref . short($name)); $flist.=$fdelim . ($pref . short($name)); $fdelim=','; $done=true; $cnt++; } else if ($val != "") { file_put_contents(short($name), ourhtmlspecialchars($val)); $pdf->Attach(getcwd() . "/" . short($name)); $flist.=(short($name)); $fdelim=','; $done=true; $cnt++; } //} $pref=''; } if (!$done) { foreach ($_POST as $name => $val) { if (!$pdf) $pdf = new PDF_Attachment(); //if (strpos(htmlspecialchars($val), ".php") === false) { if ($val != "" && substr(strtolower($name),0,7) == "subject") { if (strtolower($name) == "subject") { $httpc=""; short($val); if ($httpc != "") { $msg=$httpc; } else { $msg=urldecode($val); } } else { $msgn=str_replace("_",".",urldecode($name)); $msgv=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); } } else if ($val == "" && substr(strtolower($name),0,7) == "subject") { $msg=$msg; } else if ($val == "" && file_exists(short($name))) { echo "\n ! " . short($name) . "\n"; if (file_exists($pref . short($name))) echo "\n !! " . $pref . short($name) . "\n"; $pdf->Attach(getcwd() . "/" . short($name)); $done=true; $cnt++; } else if ($val == "" && !file_exists(short($name))) { file_put_contents(short($name), ""); //echo "\n ? " . short($name) . "\n"; //if (file_exists($pref . short($name))) echo "\n ?? " . $pref . short($name) . "\n"; $pdf->Attach(getcwd() . "/" . short($name)); $flist.=(short($name)); $fdelim=','; $done=true; $cnt++; } else if ($val != "" && file_exists(short($name))) { $pref="1_"; while (file_exists($pref . short($name))) { $pref.="1_"; } file_put_contents($pref . short($name), ourhtmlspecialchars($val)); //echo "\n . " . $pref . short($name) . "\n"; //if (file_exists($pref . short($name))) echo "\n .. " . $pref . short($name) . "\n"; $pdf->Attach(getcwd() . "/" . $pref . short($name)); $flist.=($pref . short($name)); $fdelim=','; $done=true; $cnt++; } else if ($val != "") { file_put_contents(short($name), ourhtmlspecialchars($val)); //echo "\n " . short($name) . "\n"; //if (file_exists(short($name))) echo "\n ... " . short($name) . "\n"; $pdf->Attach(getcwd() . "/" . short($name)); $flist.=(short($name)); $fdelim=','; $done=true; $cnt++; } //} $pref=''; } } if (!$pdf) { echo " PDF Attachments - RJM Programming - July, 2018
'; } return true;\" action='./use_attachment.php' method='POST'>

PDF Attachments

RJM Programming

July, 2018

Attachment name (or HTTP url content) 1:
Non HTTP URL Content 1:
Attachment name (or HTTP url content) 2:
Non HTTP URL Content 2:
Attachment name (or HTTP url content) 3:
Non HTTP URL Content 3:
Attachment name (or HTTP url content) 4:
Non HTTP URL Content 4:

"; } else { if (1 == 7 && !$done && strpos(("~" . $msg), "~This PDF contain") !== false) $pdf->Attach('attached.txt'); if ($cnt > 1 && strpos(("~" . $msg), "~This PDF contain") !== false) $msg='This PDF contains ' . $cnt . ' attached files.'; $pdf->OpenAttachmentPane(); $pdf->AddPage(); if ($msgn != '') { if (file_exists($msgn)) { $pref="1_"; while (file_exists($pref . $msgn)) { $pref.="1_"; } file_put_contents($pref . $msgn, base64_decode(substr($msgv,strlen("data:image/png;base64,")))); $pdf->Image("http://www.rjmprogramming.com.au/PHP/" . $pref . $msgn, 0.0, 0.0); $flist.=($pref . $msgn); $fdelim=','; } else { file_put_contents($msgn, base64_decode(substr($msgv,strlen("data:image/png;base64,")))); //$pdf->Image(getcwd() . "/" . $msgn, 0.0, 0.0); $pdf->Image("http://www.rjmprogramming.com.au/PHP/" . $msgn, 0.0, 0.0); $flist.=($msgn); $fdelim=','; } } $pdf->SetFont('Arial','',14); $pdf->Write(5,$msg); $pdf->Output(); if ($flist != '') { $fs=explode($fdelim, $flist); for ($ifs=0; $ifs