Trouble with PHP formmail

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • laredotornado@zipmail.com

    Trouble with PHP formmail

    Hi, I'm using PHP 4.4.4 and have downloaded the free script
    formmail.php (version 4.1b). Wondered if anyone had experienced the
    same problem I'm having. I'm submitting a form to formmail.php, but
    none of the variables seem to be getting recognized. Here is part of
    the form I'm submitting ...

    <body onload="documen t.forms[0].submit();">
    Sending Order ...

    <form action="formmai l.php" method=post
    enctype="applic ation/x-www-form-urlencoded">
    <INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
    <INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.h tml">
    <INPUT TYPE="hidden" NAME="recipient "
    VALUE="laredoto rnado@gmail.com ">
    ....
    </form>
    </body>


    but then I get warnings like below ...

    Notice: Undefined variable: recipient in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 365

    Notice: Undefined variable: required in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 383

    Notice: Undefined variable: require in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 388

    Notice: Undefined variable: email in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 429

    but as you can see above, "recipient" and "email" are clearly defined.
    What am I doing wrong?

    Thanks, - Dave

  • ZeldorBlat

    #2
    Re: Trouble with PHP formmail


    laredotornado@z ipmail.com wrote:
    Hi, I'm using PHP 4.4.4 and have downloaded the free script
    formmail.php (version 4.1b). Wondered if anyone had experienced the
    same problem I'm having. I'm submitting a form to formmail.php, but
    none of the variables seem to be getting recognized. Here is part of
    the form I'm submitting ...
    >
    <body onload="documen t.forms[0].submit();">
    Sending Order ...
    >
    <form action="formmai l.php" method=post
    enctype="applic ation/x-www-form-urlencoded">
    <INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
    <INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.h tml">
    <INPUT TYPE="hidden" NAME="recipient "
    VALUE="laredoto rnado@gmail.com ">
    ...
    </form>
    </body>
    >
    >
    but then I get warnings like below ...
    >
    Notice: Undefined variable: recipient in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 365
    >
    Notice: Undefined variable: required in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 383
    >
    Notice: Undefined variable: require in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 388
    >
    Notice: Undefined variable: email in
    /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 429
    >
    but as you can see above, "recipient" and "email" are clearly defined.
    What am I doing wrong?
    >
    Thanks, - Dave
    The script you've downloaded likely requires register_global s to be
    enabled (bad) and your server has it disabled (good). Either turn it
    on in php.ini (bad) or get a newer version of the script that doesn't
    require it (good). If there isn't a version of formmail.php that
    doesn't require register globals then I'd look for another script.

    Comment

    • Andy Hassall

      #3
      Re: Trouble with PHP formmail

      On 6 Nov 2006 08:06:32 -0800, "laredotornado@ zipmail.com"
      <laredotornado@ zipmail.comwrot e:
      >Hi, I'm using PHP 4.4.4 and have downloaded the free script
      >formmail.php (version 4.1b). Wondered if anyone had experienced the
      >same problem I'm having. I'm submitting a form to formmail.php, but
      >none of the variables seem to be getting recognized. Here is part of
      >the form I'm submitting ...
      >
      ><body onload="documen t.forms[0].submit();">
      >Sending Order ...
      >
      ><form action="formmai l.php" method=post
      >enctype="appli cation/x-www-form-urlencoded">
      <INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
      <INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.h tml">
      <INPUT TYPE="hidden" NAME="recipient "
      >VALUE="laredot ornado@gmail.co m">
      >...
      ></form>
      ></body>
      >
      >
      >but then I get warnings like below ...
      >
      >Notice: Undefined variable: recipient in
      >/usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 365
      >
      >but as you can see above, "recipient" and "email" are clearly defined.
      They're not clearly defined at all. They're in your form, but that doesn't
      mean there will be a $recipient variable.

      The script should be looking in $_POST['recipient'], etc., and if it's not,
      then it's assuming the deprecated and potentially dangerous "register_globa ls"
      option is on (search the manual or Google for more info), and so the script is
      very old and hasn't been updated for the past several years of changes in PHP.

      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      • Kimmo Laine

        #4
        Re: Trouble with PHP formmail

        "ZeldorBlat " <zeldorblat@gma il.comwrote in message
        news:1162830499 .134636.112980@ h48g2000cwc.goo glegroups.com.. .
        >
        laredotornado@z ipmail.com wrote:
        >Hi, I'm using PHP 4.4.4 and have downloaded the free script
        >formmail.php (version 4.1b). Wondered if anyone had experienced the
        >same problem I'm having. I'm submitting a form to formmail.php, but
        >none of the variables seem to be getting recognized. Here is part of
        >the form I'm submitting ...
        >>
        ><body onload="documen t.forms[0].submit();">
        >Sending Order ...
        >>
        ><form action="formmai l.php" method=post
        >enctype="appli cation/x-www-form-urlencoded">
        > <INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
        > <INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.h tml">
        > <INPUT TYPE="hidden" NAME="recipient "
        >VALUE="laredot ornado@gmail.co m">
        >...
        ></form>
        ></body>
        >
        The script you've downloaded likely requires register_global s to be
        enabled (bad) and your server has it disabled (good). Either turn it
        on in php.ini (bad) or get a newer version of the script that doesn't
        require it (good). If there isn't a version of formmail.php that
        doesn't require register globals then I'd look for another script.
        I'd look for another script in any case. That one is the kind of that
        spammers exploit to deliver their junkmail to people. Recipient in a hidden
        field, come on!! It will become a spam relay faster than you can say
        supercalifragil isticexpialidoc ious... >:(


        --
        "Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
        http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
        spam@outolempi. net | rot13(xvzzb@bhg byrzcv.arg)


        Comment

        • william.clarke

          #5
          Re: Trouble with PHP formmail

          Those are just Notices about undefined variables, if you don't want to
          go over the script and you don't want to see them just change your
          error reporting level to E_ALL & ~E_NOTICE in your PHP.ini file (or
          just for the script in question).
          Personally I'd try to fix the variables in question but that is up to
          the individual developer as they are not critical errors or faults.

          Comment

          Working...