Показать сообщение отдельно

  #2  
Старый 27.12.2008, 20:48
saiman
Banned
Регистрация: 02.12.2005
Сообщений: 63
Провел на форуме:
243503

Репутация: -15
По умолчанию

Ну может кто поможет? Что сюда запихать что бы можно было присоединять файлы или картинки? Желательно, что бы можно было присоединять много файлов, а не один.
PHP код:
<?
if (@function_exists("mail"))
{
include 
"config.php";
?>

<?
if (isset($_GET['send']) and isset($_POST['sform']))    
    {
$to trim($_POST['to']);
if (
$to != "")
{
$from $_POST['from'];
$theme $_POST['theme'];
$content $_POST['content'];
$to ereg_replace (",([^ ]{1})"", \\1"$to);
$theme $theme==""?"No subject":$theme;
if (@
$_POST['cyr_encode'] == "yes")
$theme "=?koi8-r?B?".base64_encode(convert_cyr_string($theme"w","k"))."?=";

if (@
$_POST['html'] == "yes")
$ctype "html";
else
$ctype "plane";

$header "Content-Type: text/$ctype; charset=\"$charset\" \r\n";
$header .= "From: $from \r\n";
$header .= "X-Mailer: PHP-Mailer by s1ayer[www.spg.arbse.net] \r\n";

if (@
$_POST['hide_addr'] == "yes")
        {
    
$error 0;
    
$to_array explode (", "$to);
    for (
$i=0$i<count($to_array); $i++)
            {
    if (
$to_array == "")
    continue;

    if (!@
mail($to_array[$i], $theme$content$header))
        
$error++;

            }
if (
$error == 0)
print 
"Отправка письма завершилась без ошибок<br><br>";
else
print 
"Невозможно отправить письмо!<br><br>";

        }
    else
        {
if (@
mail($to$theme$content$header))
    print 
"Отправка письма завершилась без ошибок<br><br>";
else
    print 
"Невозможно отправить письмо!<br><br>";
        }

}
else
    print 
"Вы не заполнили поле 'Кому' !<br><br>";

    }
?>
<SCRIPT LANGUAGE="JavaScript">
<!--
function hide_button (){
document.getElementById('button').style.display = "none";
document.getElementById('processing').style.display = "block";
}
//-->
</SCRIPT>
<form action="?send" method="post">
<table>
<tr><td>Кому:</td><td><input type="text" name="to" value="<?=$default_to?>" size=40></td></tr>
<tr><td>От кого:</td><td><input type="text" name="from" value="<?=$default_from?>" size=40></td></tr>
<tr><td>Тема:</td><td><input type="text" name="theme" size=40></td></tr>
<tr><td valign="top">Содержание:</td><td><textarea name="content" rows=9 cols=50><?=$default_sign?></textarea></td></tr>
<tr><td colspan=2>
Опции:<br>
<ul>
<li>отправить в HTML ? <input type="checkbox" name="html" value="yes"></li>
<li>кодировать заголовок письма в koi8 ? <input type="checkbox" name="cyr_encode" value="yes" checked></li>
<li>скрыть других адресатов ? <input type="checkbox" name="hide_addr" value="yes" checked></li>
</ul>
</td>
</tr>
<tr><td colspan=2 align="right"><input type="hidden" name="sform" value="yes"><input type="submit" value="Отправить" id=button style="display: block" onClick="hide_button()"><button id="processing" style="display: none" disabled>Пожалуйста, ждите...</button></td></tr>
</table>
</form>

<?
}
else
print 
"Извините, сервер не поддерживает функции <tt>mail ()</tt>";
?>

PHP код:
<?
$charset 
"windows-1251"//кодировка письма
$default_to "slayer <admin_progamers@rambler.ru>, somebody <mail@server.com>"//адресаты по умолчанию
$default_from "s1ayer <admin_progamers@rambler.ru>"//отправитель по умолчанию
$default_sign "\r\n---\r\nBest regards, admin (http://www.spg.arbse.net)"//подпись в теле письма
?>
 
Ответить с цитированием