Avatar billede sbay Nybegynder
02. juni 2006 - 13:56 Der er 4 kommentarer og
1 løsning

Mailinglist sender selv

Hejsa

Jeg får utilsigt sendt mail til min mailinglister, når søgemaskiner mv. rammer denne side. Hvis jeg bare åbner siden fra min editor, sender den mail - hvorfor!


<?php
session_start();
include("../login/sider.php");
if ($_SESSION['status'] == "login")
{

}
else
{
print("    <script language='javascript'>
        location.href='../login/login.php';
       
        </script>");
}


#########################################################
# MailingList                                          #
#########################################################
#                                                      #
# Created by: Doni Ronquillo                            #
#                                                      #
# This script and all included functions, images,      #
# and documentation are copyright 2003                  #
# free-php.net (http://free-php.net) unless            #
# otherwise stated in the module.                      #
#                                                      #
# Any copying, distribution, modification with          #
# intent to distribute as new code will result          #
# in immediate loss of your rights to use this          #
# program as well as possible legal action.            #
#                                                      #
#########################################################

    require('http://www.xxxxxx.dk/MailingList/inc/config.php');
    include('http://www.xxxxx.dk/MailingList/inc/header.php');
   
mysql_connect("mysql.xxxxx.dk", "xxxxx", "xxxxx");
mysql_select_db("xxxxxx");

?>

    <TABLE BORDER=0 width=100%>
        <TR><TD VALIGN=top>

<?
    $sql2 = "select email from mail";

    $res2 = mysql_query($sql2) or die("Couldn't get addresses.");

    $headers = "From: \""."xxxxxx"."\" <"."no_reply@xxxxx.dk".">";

echo "qqqq";
// echo $message;
echo $HTTP_POST_VARS[message];
echo "1";
echo $HTTP_POST_VARS[subject];
echo "2";

    while ($row = mysql_fetch_array($res2)) {

        $email_addr = $row[0];
        $subject = $HTTP_POST_VARS[subject];
        $INSERTLINK = "true";
        echo "bb";
echo $INSERTLINK;
echo "mm";

        if ($INSERTLINK == "true") {
            $fullmessage = $HTTP_POST_VARS[message] . "

            -------------------------------------------------------
            Unsubscribe Below
            :: " . "http://www.xxxxx.dk/MailingList/" . "unsubscribe.php?email=" . $email_addr . "
            -------------------------------------------------------";
        } else {
            $fullmessage = $HTTP_POST_VARS[message];
        }

        mail("$email_addr", "$subject", $fullmessage, $headers);

    }

    echo "<center>email sent!</center>";

?>

            </tD></tR>
    </TABLE>


<?



include('http://www.xxxxx.dk/MailingList/inc/footer.php');

?>
Avatar billede iss Novice
02. juni 2006 - 13:59 #1
if ($_SESSION['status'] == "login")
{
[her skal du flyttet alt under:
        </script>");
}
til
]
}
Avatar billede sbay Nybegynder
02. juni 2006 - 14:16 #2
Ok - nu får jeg se en fejl i linie 83...

Parse error: parse error, unexpected $end in D:\home\xxxxxxx\www\MailingList\admin\send.php on line 83



<?php
session_start();
include("../login/sider.php");
if ($_SESSION['status'] == "login")
{

#########################################################
# MailingList                                          #
#########################################################
#                                                      #
# Created by: Doni Ronquillo                            #
#                                                      #
# This script and all included functions, images,      #
# and documentation are copyright 2003                  #
# free-php.net (http://free-php.net) unless            #
# otherwise stated in the module.                      #
#                                                      #
# Any copying, distribution, modification with          #
# intent to distribute as new code will result          #
# in immediate loss of your rights to use this          #
# program as well as possible legal action.            #
#                                                      #
#########################################################

    require('http://www.xxxxxx.dk/MailingList/inc/config.php');
    include('http://www.xxxxxx.dk/MailingList/inc/header.php');
   
mysql_connect("mysql.xxxxxx.dk", "xxxxxxdk", "xxxxx");
mysql_select_db("xxxxxxdk");
?>
    <TABLE BORDER=0 width=100%>
        <TR><TD VALIGN=top>
<?
    $sql2 = "select email from mail";
    $res2 = mysql_query($sql2) or die("Couldn't get addresses.");
    $headers = "From: \""."xxxxxxxx"."\" <"."no_reply@xxxxxx.dk".">";
echo "qqqq";
// echo $message;
echo $HTTP_POST_VARS[message];
echo "1";
echo $HTTP_POST_VARS[subject];
echo "2";

    while ($row = mysql_fetch_array($res2)) {

        $email_addr = $row[0];
        $subject = $HTTP_POST_VARS[subject];
        $INSERTLINK = "true";
        echo "bb";
echo $INSERTLINK;
echo "mm";

        if ($INSERTLINK == "true") {
            $fullmessage = $HTTP_POST_VARS[message] . "
            -------------------------------------------------------
            Unsubscribe Below
            :: " . "http://www.xxxxxx.dk/MailingList/" . "unsubscribe.php?email=" . $email_addr . "
            -------------------------------------------------------";
        } else {
            $fullmessage = $HTTP_POST_VARS[message];
        }
        mail("$email_addr", "$subject", $fullmessage, $headers);
    }
    echo "<center>email sent!</center>";
?>

</tD></tR>    </TABLE>

<? include('http://www.xxxxxx.dk/MailingList/inc/footer.php'); ?>



}
else
{
print("    <script language='javascript'>
        location.href='../login/login.php';
       
        </script>");
}
Avatar billede iss Novice
02. juni 2006 - 14:17 #3
<? include('http://www.xxxxxx.dk/MailingList/inc/footer.php'); ?>

Tager du ?> og flytter ned til sidst i filen.
Avatar billede sbay Nybegynder
02. juni 2006 - 14:19 #4
godt så - det så jeg også lige :-)

Smid et svar så du kan få point!
Avatar billede iss Novice
02. juni 2006 - 14:34 #5
.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester