13d12 < $att=false; 46,49c45,47 < $msg=array('This PDF contains an attached file.'); < $msgn=array(''); < $msgv=array(''); < $imsg=0; --- > $msg='This PDF contains an attached file.'; > $msgn=''; > $msgv=''; 53,60d50 < $lastsub=''; < $lastsubi=''; < $names=","; < $ndelim=""; < foreach ($_GET as $name => $val) { < $names.=$ndelim . short($name); // . '=' . urldecode($val); < $ndelim=","; < } 65,71c55 < if (strtolower($name) == "subject" || (strpos(urldecode($name),".") === false && strpos(urldecode($name),"_") === false)) { < if ($lastsub != "" && urldecode($name) != $lastsub) { < $msg[$imsg + 1]=''; < } < if (sizeof($msg) > $imsg) { < $imsg++; < } --- > if (strtolower($name) == "subject") { 74,80c58,59 < if ($httpc != "" || $imsg > 0) { < $msg[$imsg]=$httpc; < $msg[$imsg]=urldecode($val); < if (sizeof($msgn) > $imsg) { < $msgn[$imsg]=''; < $msgv[$imsg]=''; < } --- > if ($httpc != "") { > $msg=$httpc; 82,86c61 < $msg[$imsg]=urldecode($val); < if (sizeof($msgn) > $imsg) { < $msgn[$imsg]=''; < $msgv[$imsg]=''; < } --- > $msg=urldecode($val); 88d62 < $lastsub=urldecode($name); 90,112c64,65 < if ($lastsubi != "" && urldecode($name) != $lastsubi) { < $msgn[$imsg + 1]=''; < $msgv[$imsg + 1]=''; < $names.=' 00'; < } < if (sizeof($msgn) > $imsg) { < $imsg++; < } < if (strpos($names, "," . explode(".",str_replace("subject2","subject",str_replace("_",".",urldecode($name))))[0] . ",") !== false) { < $jmsg=1; < while ($msgn[$jmsg] != '') { < $jmsg++; < } < $msgn[$jmsg]=str_replace("_",".",urldecode($name)); < $msgv[$jmsg]=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); < } else { < $msgn[$imsg]=str_replace("_",".",urldecode($name)); < $msgv[$imsg]=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); < } < if (sizeof($msg) > $imsg) { < $msg[$imsg]=''; < } < $lastsubi=urldecode($name); --- > $msgn=str_replace("_",".",urldecode($name)); > $msgv=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); 115,123c68 < if ($lastsub != "" && urldecode($name) != $lastsub) { < $msg[$imsg + 1]=''; < } < if (sizeof($msg) > $imsg) { < $imsg++; < $names.=' 0'; < } < $msg[$imsg]=$msg[$imsg]; < $lastsub=urldecode($name); --- > $msg=$msg; 126d70 < $att=true; 132d75 < $att=true; 144d86 < $att=true; 152d93 < $att=true; 162,174d102 < $names=","; < $ndelim=""; < foreach ($_POST as $name => $val) { < $names.=$ndelim . short($name); // . '=' . urldecode($val); < $ndelim=","; < } < //if ($names != "") { < //echo $names; < //exit; < //} < // 0 1 00 0 1 6 7 00 5 6 < // This PDF contains an attached file.,page 1, < // ,,subject22.png 179,187c107 < if (strtolower($name) == "subject" || (strpos(urldecode($name),".") === false && strpos(urldecode($name),"_") === false)) { < if ($lastsub != "" && urldecode($name) != $lastsub) { < $msg[$imsg + 1]=''; < $names.=' 00' . urldecode($name); < } < if (sizeof($msg) > $imsg) { < $imsg++; < $names.=' 0'; < } --- > if (strtolower($name) == "subject") { 190,198c110,111 < if ($httpc != "" || $imsg > 0) { < $msg[$imsg]=$httpc; < $msg[$imsg]=urldecode($val); < $names.=' 1'; < if (sizeof($msgn) > $imsg) { < $names.=' 2'; < $msgn[$imsg]=''; < $msgv[$imsg]=''; < } --- > if ($httpc != "") { > $msg=$httpc; 200,206c113 < $msg[$imsg]=urldecode($val); < $names.=' 3.' . $imsg; < if (sizeof($msgn) > $imsg) { < $names.=' 4'; < $msgn[$imsg]=''; < $msgv[$imsg]=''; < } --- > $msg=urldecode($val); 208d114 < $lastsub=urldecode($name); 210,237c116,117 < if ($lastsubi != "" && urldecode($name) != $lastsubi && strpos($names, "," . explode(".",str_replace("subject2","subject",str_replace("_",".",urldecode($name))))[0] . ",") === false) { < $msgn[$imsg + 1]=''; < $msgv[$imsg + 1]=''; < $names.=' 000' . urldecode($name); < } < if (sizeof($msgn) > $imsg) { < $names.=' 5'; < $imsg++; < } < $names.=' 6'; < if (strpos($names, "," . explode(".",str_replace("subject2","subject",str_replace("_",".",urldecode($name))))[0] . ",") !== false) { < $jmsg=1; < while ($msgn[$jmsg] != '') { < $jmsg++; < } < $msgn[$jmsg]=str_replace("_",".",urldecode($name)); < $msgv[$jmsg]=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); < $names.=' 65'; < } else { < $names.=' 675'; < $msgn[$imsg]=str_replace("_",".",urldecode($name)); < $msgv[$imsg]=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); < if (sizeof($msg) > $imsg) { < $names.=' 7'; < $msg[$imsg]=''; < } < } < $lastsubi=urldecode($name); --- > $msgn=str_replace("_",".",urldecode($name)); > $msgv=str_replace('$@$','+',str_replace('@!@','+',urldecode($val))); 240,249c120 < $names.=' 8'; < if ($lastsub != "" && urldecode($name) != $lastsub) { < $msg[$imsg + 1]=''; < } < if (sizeof($msg) > $imsg) { < $imsg++; < $names.=' 0'; < } < $msg[$imsg]=$msg[$imsg]; < $lastsub=urldecode($name); --- > $msg=$msg; 251d121 < $names.=' 9'; 255d124 < $att=true; 259d127 < $names.=' a'; 264d131 < $att=true; 270d136 < $names.=' b'; 275d140 < $names.=' c'; 280d144 < $att=true; 290d153 < $att=true; 299,302d161 < if ($names != "") { < //echo $names; < //exit; < } 314,315d172 < var curpage=1; < var dtemplate=''; 321c178 < document.getElementById('tdmiddle').innerHTML='==>
==>
==>
==>
' + curpage + '
==>
==>
==>
==>
'; --- > document.getElementById('tdmiddle').innerHTML='==>
==>
==>
==>
==>
==>
==>
'; 337,359d193 < < function andthen() { < document.getElementById('sumsubject' + eval(-1 + curpage)).innerHTML='Page ' + eval(-1 + curpage); < } < < function addpage(pwhat,swhat) { < swhat.innerHTML=''; < curpage++; < if (document.getElementById('subject').title.indexOf('data:image/') == 0) { < document.getElementById('dsubject' + curpage).innerHTML=dtemplate.replace(/1/g, '' + curpage) + '
'; < } else { < document.getElementById('dsubject' + curpage).innerHTML=dtemplate.replace(/1/g, '' + curpage) + '
'; < } < setTimeout(andthen,500); //document.getElementById('sumsubject' + eval(-1 + curpage)).innerHTML='Page ' + eval(-1 + curpage); < document.getElementById('detsubject' + eval(-1 + curpage)).setAttribute('open',false); < document.getElementById('subject').title=''; < if (document.getElementById('scurp')) { < document.getElementById('scurp').innerHTML='' + curpage; < } < } < function atstart() { < dtemplate=document.getElementById('dsubject1').outerHTML.replace('name=' + String.fromCharCode(34) + 'subject' + String.fromCharCode(34),'name=' + String.fromCharCode(34) + 'subject1' + String.fromCharCode(34)).replace('id=' + String.fromCharCode(34) + 'subject' + String.fromCharCode(34),'id=' + String.fromCharCode(34) + 'subject1' + String.fromCharCode(34)); < } 362,363c196,197 < <
'; } return true;\" action='./use_attachment.php' method='POST'> --- > > '; } return true;\" action='./use_attachment.php' method='POST'> 368c202 <
+
--- > 381,382c215,216 < if (1 == 7 && !$done && strpos(("~" . $msg[0]), "~This PDF contain") !== false) $pdf->Attach('attached.txt'); < if ($cnt > 1 && strpos(("~" . $msg[0]), "~This PDF contain") !== false) $msg[0]='This PDF contains ' . $cnt . ' attached files.'; --- > 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.'; 384,388d217 < if ($names != "") { < //echo $names . ' === ' . $imsg . ' ... ' . sizeof($msg) . ' ... ' . sizeof($msgn) . ' ... ' . $msg[0] . ' ... ' . $msg[1] . "
\n" . $msg[0] . "," . $msg[1] . "," . $msg[2] . "
\n" . $msgn[0] . "," . $msgn[1] . "," . $msgn[2]; < //exit; < } < for ($jmsg=(sizeof($msg) - $imsg); $jmsg<=$imsg; $jmsg++) { 390,392c219,220 < if (sizeof($msgn) > $jmsg) { < if ($msgn[$jmsg] != '') { < if (file_exists($msgn[$jmsg])) { --- > if ($msgn != '') { > if (file_exists($msgn)) { 394c222 < while (file_exists($pref . $msgn[$jmsg])) { --- > while (file_exists($pref . $msgn)) { 397,399c225,227 < file_put_contents($pref . $msgn[$jmsg], base64_decode(substr($msgv[$jmsg],strlen("data:image/png;base64,")))); < $pdf->Image("http://www.rjmprogramming.com.au/PHP/" . $pref . $msgn[$jmsg], 0.0, 0.0); < $flist.=($pref . $msgn[$jmsg]); --- > 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); 402,405c230,233 < file_put_contents($msgn[$jmsg], base64_decode(substr($msgv[$jmsg],strlen("data:image/png;base64,")))); < //$pdf->Image(getcwd() . "/" . $msgn[$jmsg], 0.0, 0.0); < $pdf->Image("http://www.rjmprogramming.com.au/PHP/" . $msgn[$jmsg], 0.0, 0.0); < $flist.=($msgn[$jmsg]); --- > 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); 409,410d236 < } < if (sizeof($msg) > $jmsg) { 412,422c238 < if ($msg[$jmsg] != '') { < $pdf->Write(5,$msg[$jmsg]); < } else if ($imsg == 0 && $att && $cnt > 0) { < $pdf->Write(5,'This PDF contains ' . $cnt . ' attached file(s).'); < } else if ($jmsg == (sizeof($msg) - $imsg) && $jmsg == $imsg && $att && $cnt > 0) { < $pdf->Write(5,'This PDF contains ' . $cnt . ' attached file(s).'); < } < } else if ($jmsg == (sizeof($msg) - $imsg) && $jmsg == $imsg && $att && $cnt > 0) { < $pdf->Write(5,'This PDF contains ' . $cnt . ' attached file(s).'); < } < } --- > $pdf->Write(5,$msg);