помогите с скриптом

Discussion in 'Болталка' started by Kain, 6 Feb 2006.

  1. Kain

    Kain New Member

    Joined:
    4 Feb 2006
    Messages:
    1
    Likes Received:
    0
    Reputations:
    0
    помогите пожалуйста модефицировать скрипт рассылки SR Subscribe v1.0
    там есть форма подписки дает возможность подписать только одно мыло, а мне надо чтобы старые мыла стирались и записовалась куча новых права доступа к файлу с мылами 777 (base.dat)

    сама форма

    <script language="JavaScript">
    <!--
    function win()
    {
    subscribe=window.open("","subscribe","width=300,height=200,top=0,left=0,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");
    subscribe.document.open();
    subscribe.document.write("<html><head><title>SR Subscribe v1.0</title><style> a:link {font-size: 11px; color: #6060B0; font-weight: normal; text-decoration: none} a:visited {font-size: 11px; color: #6060B0; font-weight: normal; text-decoration: none} a:active {font-size: 11px; color: #6060B0; font-weight: normal; text-decoration: none} a:hover {font-size: 11px; color: #000000; font-weight: normal; text-decoration: none}</style></head><body topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'><table width='300' height='200' border='0' cellspacing='0' cellpadding='0'><tr><td height='180' align='center' valign='middle' style='font-family:Verdana;font-size:11px;'>Идет подписка, ждите...</td></tr><tr><td height='20' align='center' valign='middle'><a href='http://www.sad-raven.ru/' target='_blank'><font style='font-family:Verdana;font-size:9px;color:#CCCCCC'>SR Subscribe v1.0 &copy; 2002</font></a></td></tr></table></body></html>");
    subscribe.document.close();
    document.sr_subscribe.submit();
    }
    //-->
    </script>
    <form action="путь к сайту/subscribe.php(это скрипт проверки)" method="POST" name="sr_subscribe" target="subscribe">
    <table border="0" bgcolor="#CCCCCC" cellspacing="1" cellpadding="1" width="150">
    <tr style="font-family:Verdana;font-size:11px;">
    <td bgcolor="#E8E8FF" colspan="2" align="center">
    SR Subscribe:
    </td>
    </tr>
    <tr>
    <td bgcolor="#FFFFFF" align="center">
    <input type="text" name="mail" size="16" value="Ваш e-mail" style="font-family:Verdana;font-size:11px;">
    </td>
    <td bgcolor="#FFFFFF" align="center">
    <input type="button" onClick="javascript:win();" value="OK" style="font-family:Verdana;font-size:11px;">
    </td>
    </tr>
    </table>
    </form>


    а это subscribe.php если надо

    <?php
    /*
    ********************************************************************
    * Название: SR Subscribe *
    ********************************************************************
    * Версия: 1.0 *
    * Стоимость: бесплатный скрипт *
    * Требования: PHP4 и выше, sendmail *
    * Платформа: любая *
    * Язык: русский *
    * Автор: Sad Raven (http://www.sad-raven.ru) *
    ********************************************************************
    * Создан: 23 августа 2002 *
    ********************************************************************
    */
    error_reporting(0);
    ?>
    <html>
    <head>
    <title>SR Subscribe v1.0</title>
    <meta http-equiv="content-type" content="text/html; charset=windows-1251">
    <meta http-equiv="pragma" content="no-cache">
    <style>
    a:link {font-size: 11px; color: #6060B0; font-weight: normal; text-decoration: none}
    a:visited {font-size: 11px; color: #6060B0; font-weight: normal; text-decoration: none}
    a:active {font-size: 11px; color: #6060B0; font-weight: normal; text-decoration: none}
    a:hover {font-size: 11px; color: #000000; font-weight: normal; text-decoration: none}
    </style>
    </head>
    <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
    <table width="300" height="200" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td height="180" align="center" valign="middle" style="font-family:Verdana;font-size:11px;">

    <?php
    if (isset($mail)):
    $mail_list = file("admin/base.dat");
    foreach ($mail_list as $mails)
    {
    list($old_mail) = explode("%", $mails);
    if ($mail == $old_mail)
    {
    echo "<font color=\"#FF0000\">Вы уже подписаны</a>";
    break;


    else
    {
    if ($mail != $old_mail)
    {
    $f = fopen("admin/base.dat","a");
    flock($f,2);
    fputs($f,"$mail%\r\n");
    flock($f,3);
    fclose($f);
    echo "Спасибо!<br><br>Вы подписаны на рассылку";
    }
    }
    endif;
    ?>
    <br><br><a href="javascript:void();" onclick="self.window.close();">Закрыть окно</a>
    </td>
    </tr>
    <tr>
    <td height="20" align="center" valign="middle">
    <a href="http://www.sad-raven.ru/" target="_blank"><font style="font-family:Verdana;font-size:9px;color:#CCCCCC">SR Subscribe v1.0 &copy; 2002</font></a>
    </td>
    </tr>
    </table>
    </body>
    </html>