Can anyone see a problem with this email script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pete Marsh

    #1

    Can anyone see a problem with this email script?

    Wondering if anyone can see an error with this script. I get a server
    configuration error. THat could mean a module is not being loaded, but
    maybe there's a syntax error here, can anyone spot it? Thanks

    <?

    Error_Reporting (E_ALL & ~E_NOTICE);
    $subject="from ".$_REQUEST['Your_Name:'] ;
    $headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
    $headers.='Cont ent-type: text/html; charset=iso-8859-1';
    $message='';
    while ($field = current($_REQUE ST)) {
    if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
    ="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
    ="i")) {
    $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
    $field."<br>";
    }
    next($_REQUEST) ;
    }
    $message.="<br> ".$_REQUEST['Message:'];
    mail($_REQUEST['recipient'], $subject, "
    <html>
    <head>
    <title>Contac t letter</title>
    </head>
    <body>
    <br>
    ".$message. "
    </body>
    </html>" , $headers);
    echo ("Your message was successfully sent!");

    ?>

  • Rami Elomaa

    #2
    Re: Can anyone see a problem with this email script?

    Pete Marsh kirjoitti:
    Wondering if anyone can see an error with this script. I get a server
    configuration error. THat could mean a module is not being loaded, but
    maybe there's a syntax error here, can anyone spot it? Thanks
    >
    <?
    >
    Error_Reporting (E_ALL & ~E_NOTICE);
    $subject="from ".$_REQUEST['Your_Name:'] ;
    $headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
    $headers.='Cont ent-type: text/html; charset=iso-8859-1';
    $message='';
    while ($field = current($_REQUE ST)) {
    if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
    ="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
    ="i")) {
    $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
    $field."<br>";
    }
    next($_REQUEST) ;
    }
    $message.="<br> ".$_REQUEST['Message:'];
    mail($_REQUEST['recipient'], $subject, "
    <html>
    <head>
    <title>Contac t letter</title>
    </head>
    <body>
    <br>
    ".$message. "
    </body>
    </html>" , $headers);
    echo ("Your message was successfully sent!");
    >
    ?>
    >
    Have you tried with the very simplest possible mail? I mean just leave
    out all the form shit and custom headers and such and just try:

    mail('your_emai l@example.com', 'this is a test', 'Hello Kitty!');

    And if you get a server configuration error with that, then it's not a
    php problem, it's a configuration problem. If not, you can slowly start
    adding the stuff you have above to your mail and then see where it goes
    wrong.

    BTW. It's not against the law or anything to have colons in field names,
    but just to be on the safe side, I wouldn't use them. They serve no
    purpouse and it's just not customary to do so. I actually had to test to
    see if they really really work, and yes they do, but it's still quite
    odd to do so. I was thinking the old "dots are converted to undescores"
    trick...

    --
    Rami.Elomaa@gma il.com
    "Olemme apinoiden planeetalla."

    Comment

    • Pete Marsh

      #3
      Re: Can anyone see a problem with this email script?

      On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
      Pete Marsh kirjoitti:
      >
      >
      >
      Wondering if anyone can see an error with this script. I get a server
      configuration error. THat could mean a module is not being loaded, but
      maybe there's a syntax error here, can anyone spot it? Thanks
      >
      <?
      >
      Error_Reporting (E_ALL & ~E_NOTICE);
      $subject="from ".$_REQUEST['Your_Name:'] ;
      $headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
      $headers.='Cont ent-type: text/html; charset=iso-8859-1';
      $message='';
      while ($field = current($_REQUE ST)) {
      if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
      ="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
      ="i")) {
      $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
      $field."<br>";
      }
      next($_REQUEST) ;
      }
      $message.="<br> ".$_REQUEST['Message:'];
      mail($_REQUEST['recipient'], $subject, "
      <html>
      <head>
      <title>Contac t letter</title>
      </head>
      <body>
      <br>
      ".$message. "
      </body>
      </html>" , $headers);
      echo ("Your message was successfully sent!");
      >
      ?>
      >
      Have you tried with the very simplest possible mail? I mean just leave
      out all the form shit and custom headers and such and just try:
      >
      mail('your_em.. .@example.com', 'this is a test', 'Hello Kitty!');
      >
      And if you get a server configuration error with that, then it's not a
      php problem, it's a configuration problem. If not, you can slowly start
      adding the stuff you have above to your mail and then see where it goes
      wrong.
      >
      BTW. It's not against the law or anything to have colons in field names,
      but just to be on the safe side, I wouldn't use them. They serve no
      purpouse and it's just not customary to do so. I actually had to test to
      see if they really really work, and yes they do, but it's still quite
      odd to do so. I was thinking the old "dots are converted to undescores"
      trick...
      >
      --
      Rami.Elo...@gma il.com
      "Olemme apinoiden planeetalla."


      hi yes your basic mail works, so it's something else.
      it's a very weird set up I've inherited. They have the actual form
      separated out and embeded in a flash app, so I can't even see it! Then
      they ahve two separate php scripts, one to handle the form processing,
      and this one to handle to email respone. but the form processor does
      not seem to point to this email script. What a mess.

      Comment

      • Rami Elomaa

        #4
        Re: Can anyone see a problem with this email script?

        Pete Marsh kirjoitti:
        On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
        >Pete Marsh kirjoitti:
        >>
        >>
        >>
        >>Wondering if anyone can see an error with this script. I get a server
        >>configurati on error. THat could mean a module is not being loaded, but
        >>maybe there's a syntax error here, can anyone spot it? Thanks
        >><?
        >>Error_Reporti ng(E_ALL & ~E_NOTICE);
        >>$subject="fro m ".$_REQUEST['Your_Name:'] ;
        >>$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
        >> $headers.='Cont ent-type: text/html; charset=iso-8859-1';
        >> $message='';
        >> while ($field = current($_REQUE ST)) {
        >> if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
        >>="Your_Email: ") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
        >>="i")) {
        >> $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
        >>$field."<br>" ;
        >> }
        >> next($_REQUEST) ;
        >> }
        >>$message.="<b r>".$_REQUEST['Message:'];
        >>mail($_REQUES T['recipient'], $subject, "
        >><html>
        >><head>
        >> <title>Contac t letter</title>
        >></head>
        >><body>
        >><br>
        >> ".$message. "
        >></body>
        >></html>" , $headers);
        >>echo ("Your message was successfully sent!");
        >>?>
        >Have you tried with the very simplest possible mail? I mean just leave
        >out all the form shit and custom headers and such and just try:
        >>
        >mail('your_em. ..@example.com' ,'this is a test', 'Hello Kitty!');
        >>
        >And if you get a server configuration error with that, then it's not a
        >php problem, it's a configuration problem. If not, you can slowly start
        >adding the stuff you have above to your mail and then see where it goes
        >wrong.
        >>
        >BTW. It's not against the law or anything to have colons in field names,
        >but just to be on the safe side, I wouldn't use them. They serve no
        >purpouse and it's just not customary to do so. I actually had to test to
        >see if they really really work, and yes they do, but it's still quite
        >odd to do so. I was thinking the old "dots are converted to undescores"
        >trick...
        >>
        >--
        >Rami.Elo...@gm ail.com
        >"Olemme apinoiden planeetalla."
        >
        >
        >
        hi yes your basic mail works, so it's something else.
        it's a very weird set up I've inherited. They have the actual form
        separated out and embeded in a flash app, so I can't even see it! Then
        they ahve two separate php scripts, one to handle the form processing,
        and this one to handle to email respone. but the form processor does
        not seem to point to this email script. What a mess.
        >
        Well you could try looking at what the form actually passes to the
        script. Put something like this at the very beginning of your mail script:

        file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));

        Kinda like trap what it's trying to send and try to figure out if
        there's something wrong there, missing parameters or something.

        The form being flash explains the colons though... Flash designers...

        --
        Rami.Elomaa@gma il.com
        "Olemme apinoiden planeetalla."

        Comment

        • Pete Marsh

          #5
          Re: Can anyone see a problem with this email script?

          On Apr 10, 12:47 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
          Pete Marsh kirjoitti:
          >
          >
          >
          On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
          Pete Marsh kirjoitti:
          >
          >Wondering if anyone can see an error with this script. I get a server
          >configuratio n error. THat could mean a module is not being loaded, but
          >maybe there's a syntax error here, can anyone spot it? Thanks
          ><?
          >Error_Reportin g(E_ALL & ~E_NOTICE);
          >$subject="fr om ".$_REQUEST['Your_Name:'] ;
          >$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
          > $headers.='Cont ent-type: text/html; charset=iso-8859-1';
          > $message='';
          > while ($field = current($_REQUE ST)) {
          > if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
          >="Your_Email:" ) && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
          >="i")) {
          > $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
          >$field."<br> ";
          > }
          > next($_REQUEST) ;
          > }
          >$message.="<br >".$_REQUEST['Message:'];
          >mail($_REQUE ST['recipient'], $subject, "
          ><html>
          ><head>
          > <title>Contac t letter</title>
          ></head>
          ><body>
          ><br>
          > ".$message. "
          ></body>
          ></html>" , $headers);
          >echo ("Your message was successfully sent!");
          >?>
          Have you tried with the very simplest possible mail? I mean just leave
          out all the form shit and custom headers and such and just try:
          >
          mail('your_em.. .@example.com', 'this is a test', 'Hello Kitty!');
          >
          And if you get a server configuration error with that, then it's not a
          php problem, it's a configuration problem. If not, you can slowly start
          adding the stuff you have above to your mail and then see where it goes
          wrong.
          >
          BTW. It's not against the law or anything to have colons in field names,
          but just to be on the safe side, I wouldn't use them. They serve no
          purpouse and it's just not customary to do so. I actually had to test to
          see if they really really work, and yes they do, but it's still quite
          odd to do so. I was thinking the old "dots are converted to undescores"
          trick...
          >
          --
          Rami.Elo...@gma il.com
          "Olemme apinoiden planeetalla."
          >
          hi yes your basic mail works, so it's something else.
          it's a very weird set up I've inherited. They have the actual form
          separated out and embeded in a flash app, so I can't even see it! Then
          they ahve two separate php scripts, one to handle the form processing,
          and this one to handle to email respone. but the form processor does
          not seem to point to this email script. What a mess.
          >
          Well you could try looking at what the form actually passes to the
          script. Put something like this at the very beginning of your mail script:
          >
          file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));
          >
          Kinda like trap what it's trying to send and try to figure out if
          there's something wrong there, missing parameters or something.
          >
          The form being flash explains the colons though... Flash designers...

          Unfortunately, the form is embedded in a flash binary!
          I cannot see the source code at this time.
          Unbelievable!

          Comment

          • Rami Elomaa

            #6
            Re: Can anyone see a problem with this email script?

            Pete Marsh kirjoitti:
            On Apr 10, 12:47 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
            >Pete Marsh kirjoitti:
            >>
            >>
            >>
            >>On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
            >>>Pete Marsh kirjoitti:
            >>>>Wondering if anyone can see an error with this script. I get a server
            >>>>configurati on error. THat could mean a module is not being loaded, but
            >>>>maybe there's a syntax error here, can anyone spot it? Thanks
            >>>><?
            >>>>Error_Repor ting(E_ALL & ~E_NOTICE);
            >>>>$subject="f rom ".$_REQUEST['Your_Name:'] ;
            >>>>$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
            >>>> $headers.='Cont ent-type: text/html; charset=iso-8859-1';
            >>>> $message='';
            >>>> while ($field = current($_REQUE ST)) {
            >>>> if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
            >>>>="Your_Emai l:") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
            >>>>="i")) {
            >>>> $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
            >>>>$field."<br >";
            >>>> }
            >>>> next($_REQUEST) ;
            >>>> }
            >>>>$message.=" <br>".$_REQUE ST['Message:'];
            >>>>mail($_REQU EST['recipient'], $subject, "
            >>>><html>
            >>>><head>
            >>>> <title>Contac t letter</title>
            >>>></head>
            >>>><body>
            >>>><br>
            >>>> ".$message. "
            >>>></body>
            >>>></html>" , $headers);
            >>>>echo ("Your message was successfully sent!");
            >>>>?>
            >>>Have you tried with the very simplest possible mail? I mean just leave
            >>>out all the form shit and custom headers and such and just try:
            >>>mail('your_e m...@example.co m','this is a test', 'Hello Kitty!');
            >>>And if you get a server configuration error with that, then it's not a
            >>>php problem, it's a configuration problem. If not, you can slowly start
            >>>adding the stuff you have above to your mail and then see where it goes
            >>>wrong.
            >>>BTW. It's not against the law or anything to have colons in field names,
            >>>but just to be on the safe side, I wouldn't use them. They serve no
            >>>purpouse and it's just not customary to do so. I actually had to test to
            >>>see if they really really work, and yes they do, but it's still quite
            >>>odd to do so. I was thinking the old "dots are converted to undescores"
            >>>trick...
            >>>--
            >>>Rami.Elo...@ gmail.com
            >>>"Olemme apinoiden planeetalla."
            >>hi yes your basic mail works, so it's something else.
            >>it's a very weird set up I've inherited. They have the actual form
            >>separated out and embeded in a flash app, so I can't even see it! Then
            >>they ahve two separate php scripts, one to handle the form processing,
            >>and this one to handle to email respone. but the form processor does
            >>not seem to point to this email script. What a mess.
            >Well you could try looking at what the form actually passes to the
            >script. Put something like this at the very beginning of your mail script:
            >>
            >file_put_conte nts('my_mail_lo g.txt', print_r($_REQUE ST, 1));
            >>
            >Kinda like trap what it's trying to send and try to figure out if
            >there's something wrong there, missing parameters or something.
            >>
            >The form being flash explains the colons though... Flash designers...
            >
            >
            Unfortunately, the form is embedded in a flash binary!
            I cannot see the source code at this time.
            Unbelievable!
            >
            That's quite alright. That's why I told you to check what the form sends
            to the mail script. Insert this line at the beginning of the mailer
            script so you'll see what the flash form sends to the mailer, even if
            you can't see what is happening inside the flash:

            file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));

            And then try sending mail from the flash application and study the
            results in my_mail_log.txt .

            --
            Rami.Elomaa@gma il.com
            "Olemme apinoiden planeetalla."

            Comment

            • Toby A Inkster

              #7
              Re: Can anyone see a problem with this email script?

              Pete Marsh wrote:
              mail($_REQUEST['recipient']
              SPAMMER!

              --
              Toby A Inkster BSc (Hons) ARCS
              Contact Me ~ http://tobyinkster.co.uk/contact
              Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

              * = I'm getting there!

              Comment

              • FFMG

                #8
                Re: Can anyone see a problem with this email script?


                Toby A Inkster;60036 Wrote:
                Pete Marsh wrote:
                >
                mail($_REQUEST['recipient']
                >
                SPAMMER!
                >
                >
                Why do you say that?

                FFMG


                --
                FFMG

                'webmaster forum' (http://www.httppoint.com) | 'webmaster Directory'
                (http://www.webhostshunter.com/) | 'Recreation Vehicle insurance'
                (http://www.insurance-owl.com/other/car_rec.php)
                http://urlkick.com/-Free URL redirection service
                ------------------------------------------------------------------------
                FFMG's Profile: http://www.httppoint.com/member.php?userid=580
                View this thread: http://www.httppoint.com/showthread.php?t=13789

                Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

                Comment

                • Toby A Inkster

                  #9
                  Re: Can anyone see a problem with this email script?

                  FFMG wrote:
                  Toby A Inkster;60036 Wrote:
                  >Pete Marsh wrote:
                  >>
                  >>mail($_REQUES T['recipient']
                  >>
                  >SPAMMER!
                  >
                  Why do you say that?


                  --
                  Toby A Inkster BSc (Hons) ARCS
                  Contact Me ~ http://tobyinkster.co.uk/contact
                  Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

                  * = I'm getting there!

                  Comment

                  • FFMG

                    #10
                    Re: Can anyone see a problem with this email script?


                    Toby A Inkster;60073 Wrote:
                    FFMG wrote:
                    Toby A Inkster;60036 Wrote:
                    Pete Marsh wrote:
                    >
                    >mail($_REQUE ST['recipient']
                    >
                    SPAMMER!
                    Why do you say that?
                    >
                    http://tinyurl.com/365y5x
                    >
                    --
                    Toby A Inkster BSc (Hons) ARCS
                    Contact Me ~ http://tobyinkster.co.uk/contact
                    Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
                    >
                    * = I'm getting there!
                    Yes, that makes it a bad script.
                    But it does not make him a spammer.

                    Or maybe I am not understanding your cryptic replies, add a few more
                    words to make your point clearer.

                    FFMG


                    --

                    'webmaster forum' (http://www.httppoint.com) | 'webmaster Directory'
                    (http://www.webhostshunter.com/) | 'Recreation Vehicle insurance'
                    (http://www.insurance-owl.com/other/car_rec.php)
                    'Free URL redirection service' (http://urlkick.com/)
                    ------------------------------------------------------------------------
                    FFMG's Profile: http://www.httppoint.com/member.php?userid=580
                    View this thread: http://www.httppoint.com/showthread.php?t=13789

                    Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

                    Comment

                    • Pete Marsh

                      #11
                      Re: Can anyone see a problem with this email script?

                      On Apr 10, 3:27 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
                      wrote:
                      FFMG wrote:
                      Toby A Inkster;60036 Wrote:
                      Pete Marsh wrote:
                      >
                      >mail($_REQUE ST['recipient']
                      >
                      SPAMMER!
                      >
                      Why do you say that?
                      >

                      >
                      --
                      Toby A Inkster BSc (Hons) ARCS
                      Contact Me ~http://tobyinkster.co.uk/contact
                      Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
                      >
                      * = I'm getting there!



                      you're getting nowhere, you are an idiot.
                      I just inherited this script, I didn't write it.
                      probably you wrote it, which is why it's so bad.

                      Comment

                      • Pete Marsh

                        #12
                        Re: Can anyone see a problem with this email script?

                        On Apr 10, 3:51 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
                        Pete Marsh kirjoitti:
                        >
                        >
                        >
                        On Apr 10, 12:47 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
                        Pete Marsh kirjoitti:
                        >
                        >On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
                        >>Pete Marsh kirjoitti:
                        >>>Wondering if anyone can see an error with this script. I get a server
                        >>>configuratio n error. THat could mean a module is not being loaded, but
                        >>>maybe there's a syntax error here, can anyone spot it? Thanks
                        >>><?
                        >>>Error_Report ing(E_ALL & ~E_NOTICE);
                        >>>$subject="fr om ".$_REQUEST['Your_Name:'] ;
                        >>>$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
                        >>> $headers.='Cont ent-type: text/html; charset=iso-8859-1';
                        >>> $message='';
                        >>> while ($field = current($_REQUE ST)) {
                        >>> if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
                        >>>="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
                        >>>="i")) {
                        >>> $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
                        >>>$field."<br> ";
                        >>> }
                        >>> next($_REQUEST) ;
                        >>> }
                        >>>$message.="< br>".$_REQUEST['Message:'];
                        >>>mail($_REQUE ST['recipient'], $subject, "
                        >>><html>
                        >>><head>
                        >>> <title>Contac t letter</title>
                        >>></head>
                        >>><body>
                        >>><br>
                        >>> ".$message. "
                        >>></body>
                        >>></html>" , $headers);
                        >>>echo ("Your message was successfully sent!");
                        >>>?>
                        >>Have you tried with the very simplest possible mail? I mean just leave
                        >>out all the form shit and custom headers and such and just try:
                        >>mail('your_em ...@example.com ','this is a test', 'Hello Kitty!');
                        >>And if you get a server configuration error with that, then it's not a
                        >>php problem, it's a configuration problem. If not, you can slowly start
                        >>adding the stuff you have above to your mail and then see where it goes
                        >>wrong.
                        >>BTW. It's not against the law or anything to have colons in field names,
                        >>but just to be on the safe side, I wouldn't use them. They serve no
                        >>purpouse and it's just not customary to do so. I actually had to test to
                        >>see if they really really work, and yes they do, but it's still quite
                        >>odd to do so. I was thinking the old "dots are converted to undescores"
                        >>trick...
                        >>--
                        >>Rami.Elo...@g mail.com
                        >>"Olemme apinoiden planeetalla."
                        >hi yes your basic mail works, so it's something else.
                        >it's a very weird set up I've inherited. They have the actual form
                        >separated out and embeded in a flash app, so I can't even see it! Then
                        >they ahve two separate php scripts, one to handle the form processing,
                        >and this one to handle to email respone. but the form processor does
                        >not seem to point to this email script. What a mess.
                        Well you could try looking at what the form actually passes to the
                        script. Put something like this at the very beginning of your mail script:
                        >
                        file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));
                        >
                        Kinda like trap what it's trying to send and try to figure out if
                        there's something wrong there, missing parameters or something.
                        >
                        The form being flash explains the colons though... Flash designers...
                        >
                        Unfortunately, the form is embedded in a flash binary!
                        I cannot see the source code at this time.
                        Unbelievable!
                        >
                        That's quite alright. That's why I told you to check what the form sends
                        to the mail script. Insert this line at the beginning of the mailer
                        script so you'll see what the flash form sends to the mailer, even if
                        you can't see what is happening inside the flash:
                        >
                        file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));
                        >
                        And then try sending mail from the flash application and study the
                        results in my_mail_log.txt .

                        Thanks for these interesting replies.

                        The script is so bad, I think I'm goign to have to do it again.
                        The flash part isn't even done right either, so I have to make a test
                        form in any case.

                        Can you recommend a good generic php form parser?
                        Simpler the better.

                        Comment

                        • Pete Marsh

                          #13
                          Re: Can anyone see a problem with this email script?

                          On Apr 10, 9:05 pm, FFMG <FFMG.2ou...@ no-mx.httppoint.co mwrote:
                          Toby A Inkster;60073 Wrote:
                          >
                          >
                          >
                          FFMG wrote:
                          Toby A Inkster;60036 Wrote:
                          >Pete Marsh wrote:
                          >
                          >>mail($_REQUES T['recipient']
                          >
                          >SPAMMER!
                          >
                          Why do you say that?
                          >>
                          --
                          Toby A Inkster BSc (Hons) ARCS
                          Contact Me ~http://tobyinkster.co.uk/contact
                          Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
                          >
                          * = I'm getting there!
                          >
                          Yes, that makes it a bad script.
                          But it does not make him a spammer.
                          >
                          Or maybe I am not understanding your cryptic replies, add a few more
                          words to make your point clearer.

                          Some people just like to make a lot of noise.

                          Comment

                          • Rami Elomaa

                            #14
                            Re: Can anyone see a problem with this email script?

                            Toby A Inkster kirjoitti:
                            FFMG wrote:
                            >Toby A Inkster;60036 Wrote:
                            >>Pete Marsh wrote:
                            >>>
                            >>>mail($_REQUE ST['recipient']
                            >>SPAMMER!
                            >Why do you say that?
                            >

                            >
                            Yeah, but that's a Flash aplication he's working with. A Flash
                            application in my opinion is much more difficult to exploit than your
                            regular formmail. And for pity's sake, he wouldn't be the spammer here,
                            just a web developer who's not completly aware of spammer tactics.
                            Instead of accusing him for something he's not guilty, you could educate
                            him.

                            --
                            Rami.Elomaa@gma il.com
                            "Olemme apinoiden planeetalla."

                            Comment

                            • Rami Elomaa

                              #15
                              Re: Can anyone see a problem with this email script?

                              Pete Marsh kirjoitti:
                              On Apr 10, 3:51 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
                              >Pete Marsh kirjoitti:
                              >>
                              >>
                              >>
                              >>On Apr 10, 12:47 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
                              >>>Pete Marsh kirjoitti:
                              >>>>On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
                              >>>>>Pete Marsh kirjoitti:
                              >>>>>>Wonderi ng if anyone can see an error with this script. I get a server
                              >>>>>>configura tion error. THat could mean a module is not being loaded, but
                              >>>>>>maybe there's a syntax error here, can anyone spot it? Thanks
                              >>>>>><?
                              >>>>>>Error_Rep orting(E_ALL & ~E_NOTICE);
                              >>>>>>$subject= "from ".$_REQUEST['Your_Name:'] ;
                              >>>>>>$header s= "From: ".$_REQUEST['Your_Email:'] ."\n";
                              >>>>>> $headers.='Cont ent-type: text/html; charset=iso-8859-1';
                              >>>>>> $message='';
                              >>>>>> while ($field = current($_REQUE ST)) {
                              >>>>>> if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
                              >>>>>>="Your_Em ail:") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
                              >>>>>>="i")) {
                              >>>>>> $message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
                              >>>>>>$field."< br>";
                              >>>>>> }
                              >>>>>> next($_REQUEST) ;
                              >>>>>> }
                              >>>>>>$message. ="<br>".$_REQUE ST['Message:'];
                              >>>>>>mail($_RE QUEST['recipient'], $subject, "
                              >>>>>><html>
                              >>>>>><head>
                              >>>>>> <title>Contac t letter</title>
                              >>>>>></head>
                              >>>>>><body>
                              >>>>>><br>
                              >>>>>> ".$message. "
                              >>>>>></body>
                              >>>>>></html>" , $headers);
                              >>>>>>echo ("Your message was successfully sent!");
                              >>>>>>?>
                              >>>>>Have you tried with the very simplest possible mail? I mean just leave
                              >>>>>out all the form shit and custom headers and such and just try:
                              >>>>>mail('your _em...@example. com','this is a test', 'Hello Kitty!');
                              >>>>>And if you get a server configuration error with that, then it's not a
                              >>>>>php problem, it's a configuration problem. If not, you can slowly start
                              >>>>>adding the stuff you have above to your mail and then see where it goes
                              >>>>>wrong.
                              >>>>>BTW. It's not against the law or anything to have colons in field names,
                              >>>>>but just to be on the safe side, I wouldn't use them. They serve no
                              >>>>>purpouse and it's just not customary to do so. I actually had to test to
                              >>>>>see if they really really work, and yes they do, but it's still quite
                              >>>>>odd to do so. I was thinking the old "dots are converted to undescores"
                              >>>>>trick...
                              >>>>>--
                              >>>>>Rami.Elo.. .@gmail.com
                              >>>>>"Olemme apinoiden planeetalla."
                              >>>>hi yes your basic mail works, so it's something else.
                              >>>>it's a very weird set up I've inherited. They have the actual form
                              >>>>separated out and embeded in a flash app, so I can't even see it! Then
                              >>>>they ahve two separate php scripts, one to handle the form processing,
                              >>>>and this one to handle to email respone. but the form processor does
                              >>>>not seem to point to this email script. What a mess.
                              >>>Well you could try looking at what the form actually passes to the
                              >>>script. Put something like this at the very beginning of your mail script:
                              >>>file_put_con tents('my_mail_ log.txt', print_r($_REQUE ST, 1));
                              >>>Kinda like trap what it's trying to send and try to figure out if
                              >>>there's something wrong there, missing parameters or something.
                              >>>The form being flash explains the colons though... Flash designers...
                              >>Unfortunately , the form is embedded in a flash binary!
                              >>I cannot see the source code at this time.
                              >>Unbelievabl e!
                              >That's quite alright. That's why I told you to check what the form sends
                              >to the mail script. Insert this line at the beginning of the mailer
                              >script so you'll see what the flash form sends to the mailer, even if
                              >you can't see what is happening inside the flash:
                              >>
                              >file_put_conte nts('my_mail_lo g.txt', print_r($_REQUE ST, 1));
                              >>
                              >And then try sending mail from the flash application and study the
                              >results in my_mail_log.txt .
                              >
                              >
                              Thanks for these interesting replies.
                              >
                              The script is so bad, I think I'm goign to have to do it again.
                              The flash part isn't even done right either, so I have to make a test
                              form in any case.
                              That might just be the best solution :)

                              --
                              Rami.Elomaa@gma il.com
                              "Olemme apinoiden planeetalla."

                              Comment

                              Working...