Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Form Question(s)

  • This topic is empty.
Viewing 15 posts - 31 through 45 (of 61 total)
  • Author
    Posts
  • #83314
    justaguy
    Participant

    I don’t mean to highjack your time, get back to me as you are able ….

    I corrected the lack of closing php, no change. I guess there is only a finite number of ways I can toy with this, so as your able give it a second look.

    Thanks d

    #83307
    dhechler
    Member

    Sorry bout not getting back to ya sooner.

    Check this out. http://dev.wovenland.com/justaguy/

    thats your code working. lemme get the code i have for ya.


    $email = $_POST;
    $questions = $_POST;
    // subject
    $subject = 'Request for Information';

    // HTML message
    $message = '


    ' . $email . ' sent you a message.


    ' . $email. '


    '. $questions .'




    ';

    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "rn";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

    // Additional headers
    $headers .= 'To: <' . $_POST . '>' . "rn";
    $headers .= 'From: My Web Site ' . "rn";

    // Mail it
    mail($to, $subject, $message, $headers);
    //Send them back to the form page with a success message.
    // From here is the html to the success page after e-mail was $theResults = <<< EOD
    ?>



    My Web Site/contact














    Your request for additional information has successfully been forwarded.


    Thank you for your interest in My Web Site.


    You can expect a prompt response.
























    echo "$theResults";

    ?>
    #83285
    justaguy
    Participant

    The working code you posted does bring us to the “success” page, without an e-mail being sent. I have changed the opening php tag to include “php”. I’m not certain what the string :

    $headers = ‘MIME-Version: 1.0’ . “rn”;

    does, but I am by far behind you in knowledge.

    Are we certain that we needed to amend the ENCTYPE in the html? I’m just asking ….. again, I trust your knowledge over the lack of mine. I am just thinking about the changes that have been introduced and noting the deficiencies (now) compared to the code and symptoms we had in the beginning.

    “old code” —-> email sent, nothing captured, “success” page rendered vs

    “new code” —> no email sent, uncertain if data is being captured, and failure of “success” page being rendered (I see that a “success” page is rendered here : http://dev.wovenland.com/justaguy/) but can’t understand why it is failing on the site.

    It has to be something quite simple (and evasive) at this point.

    I appreciate you hanging in here with me (still)

    #83287
    dhechler
    Member

    Man, Im not sure why its not sending you an email on my test site. Heres how it all plays out for me.

    Fill out form
    http://i52.tinypic.com/2dhwuah.jpg

    Get Confirmation Page
    http://i56.tinypic.com/2j3407s.jpg

    Get Confirmation Email
    http://i51.tinypic.com/2i25tva.jpg

    The email comes almost immediately. Maybe it’s getting dumped into your spam folder?

    #83279
    justaguy
    Participant

    Here is something beneficial to add!

    I have been plugging an alternate (working) email address of mine into the form on the web page itself, and typing gibberish, then hitting the “send” button. As part of the script you’ve put together, the sender (from my web page) receives an e-mail to their e-mail address after completing the form.

    This is occurring, the “sender” will receive an email to their inbox and the question they type in the form is remitted to them. The “sender’s” email address is formatted as a link that when clicked opens (in this case) a response through gmail.

    A little progress, huh? :-)

    #83280
    justaguy
    Participant

    I guess I just restated what you already knew ………………

    #83281
    dhechler
    Member

    AHA! So in order for YOU to receive an email, just change this.


    // Additional headers
    $headers .= 'To: <' . $_POST . '>' . "rn";
    $headers .= 'From: My Web Site ' . "rn";

    to this


    // Additional headers
    $headers .= 'To: ' . "rn";
    $headers .= 'From: My Web Site ' . "rn";
    $headers .= 'Reply-To: <' . $_POST . '>' . "rn";

    This way you will receive the email. You can also send them a “Thank you” email with the previous code we were using.

    #83282
    dhechler
    Member

    CORRECTION. It should be this (sorry bout that)

    // Additional headers
    $headers .= 'To: [email protected]' . "rn";
    $headers .= 'From: My Web Site ' . "rn";
    $headers .= 'Reply-To: <' . $_POST . '>' . "rn";

    Basically i removed the <> from the to email.

    #83277
    justaguy
    Participant

    Before I try the above, this may be helpful, or not, in the form, on the website, I plug in my website e-mail address as “sender” and type gibberish, and no email sent to my web site email address.

    #83278
    dhechler
    Member

    let me copy all of the code over for you now. Just so we are both on the same page. Just to make sure.


    $email = $_POST;
    $questions = $_POST;
    // subject
    $subject = 'Request for Information';

    // HTML message
    $message = '


    ' . $email . ' sent you a message.


    ' . $email. '


    '. $questions .'




    ';

    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "rn";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

    // Additional headers. FILL IN YOUR EMAIL HERE
    $headers .= 'To: [email protected]' . "rn";
    $headers .= 'From: My Web Site ' . "rn";
    $headers .= 'Reply-To: <' . $_POST . '>' . "rn";
    // Mail it
    mail($to, $subject, $message, $headers);
    //Send them back to the form page with a success message.
    // From here is the html to the success page after e-mail was $theResults = <<< EOD
    ?>



    My Web Site/contact














    Your request for additional information has successfully been forwarded.


    Thank you for your interest in My Web Site.


    You can expect a prompt response.
























    echo "$theResults";

    ?>
    #83272
    justaguy
    Participant

    Hold on, something seems amiss, my error no doubt.

    #83273
    dhechler
    Member

    What are you missing?

    #83274
    dhechler
    Member

    HTML code as well.





    justaguy form test














    #83268
    justaguy
    Participant

    Geez! I tried the latest send.php and failed receiving any e-mails, after plugging in all my site/email info into place. Actually I tried a couple of times.

    Then I thought, well, I would go back and use the send.php that worked last, the one prior to the last one you submitted. No e-mail.! After making the changes to the “additional headers” and double checking my html.

    (what the hell, checkout my site here: nearnorthwebdesign.com

    stepping out for a smoke)

    #83266
    dhechler
    Member

    Well, in looking at your form code on http://www.nearnorthwebdesign.com/contact.html, you have this.










    There are 2 problems i see with this form code.

    1. contactFormprocess.php does not exist on your server. I get a 404 page when i click submit.

    2. your enctype=”text/plain” will not submit anything to your php file.

    Delete your enctype=”text/plain”. You dont need it at all.
    Create contactFormprocess.php on your server and insert the latest send.php code I’m including here.


    $email = $_POST;
    $questions = $_POST;
    // subject
    $subject = 'Request for Information';

    // HTML message
    $message = '


    ' . $email . ' sent you a message.


    ' . $email. '


    '. $questions .'




    ';

    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "rn";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

    // Additional headers. FILL IN YOUR EMAIL HERE
    $headers .= 'To: [email protected]' . "rn";
    $headers .= 'From: My Web Site ' . "rn";
    $headers .= 'Reply-To: <' . $_POST . '>' . "rn";
    // Mail it
    mail($to, $subject, $message, $headers);
    //Send them back to the form page with a success message.
    // From here is the html to the success page after e-mail was $theResults = <<< EOD
    ?>



    My Web Site/contact












    Your request for additional information has successfully been forwarded.


    Thank you for your interest in My Web Site.


    You can expect a prompt response.















    echo "$theResults";

    ?>
Viewing 15 posts - 31 through 45 (of 61 total)
  • The forum ‘Back End’ is closed to new topics and replies.