$val) { if (!$pdf) $pdf = new PDF_Attachment(); //if (strpos(htmlspecialchars($val), ".php") === false) { if ($val != "" && strtolower($name) == "subject") { $httpc=""; short($val); if ($httpc != "") { $msg=$httpc; } else { $msg=htmlspecialchars($val); } } else if ($val == "" && strtolower($name) == "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 != "" && strtolower($name) == "subject") { $httpc=""; short($val); if ($httpc != "") { $msg=$httpc; } else { $msg=htmlspecialchars($val); } } else if ($val == "" && strtolower($name) == "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

PDF Attachments

RJM Programming

July, 2018

Subject
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 (!$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(); $pdf->SetFont('Arial','',14); $pdf->Write(5,$msg); $pdf->Output(); if ($flist != '') { $fs=explode($fdelim, $flist); for ($ifs=0; $ifs