Forums

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

Home Forums Back End Submitting a form – always a hassle for me

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #33031
    tannercampbell
    Participant

    I rarely use forms, when I do I use a service like jotform.com or something similar. In this instance, since it is for my own site, I would like to NOT have to do that.

    here’s what my form looks like:




    and here’s php/sendmail.php

    
    $email = $_REQUEST ;

    mail( "[email protected]", "Flock Subscription", "From: $email" );
    header( "Location: http://www.theaddresshere.com" );
    ?>

    definitely NOT a php guy whatsoever – could I get some help? And yes, “theaddresshere” is intentional, the real site isn’t ready for viewing.

    #73964
    TT_Mark
    Member

    Do you have a specific problem with the script or are you just looking for ways to make it more secure/advanced?

    I mean…I can see things you can improve, like making sure you stripslashes() on the $_REQUEST (otherwise characters like ‘ can break the script.

    But you have the To, Subject and Message written correctly. Is something not working as it should?

    #74009
    rkacenski
    Member

    Yes, it would most likely be a server issue. Most hosting companies stager and limit the php mail() function to prevent server overload and crashes. There might not be a way to fix the delay but your syntax could use some improvement. Try something like this instead:


    //First part of the email header, is the from address
    $headers = "From: $email" . "rn";
    //Second part to include HTML and make more legit to email services
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

    $emailbody = "Body Content Here, and you can use ";

    mail("[email protected]", "Flock Subscription", $emailbody, $headers);

    Notice you were putting the “From: $email ” in the body part and left the headers null. The rest of the code should be pretty self-explanatory let me know if this helped.

    #73851
    tannercampbell
    Participant

    So then:

    
    $email = $_REQUEST;
    $headers = "From: $email" . "rn";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
    $emailbody = "$email has signed up for alerts from the Flock";

    mail("[email protected]", "Flock Subscription", $emailbody, $headers);
    ?>

    ? I will see if this works and repost if I have another issue. Thanks, I appreciate you taking the time to help me out.

    #73804
    rkacenski
    Member

    No problem code looks good let me know how you make out.

    #73806
    tannercampbell
    Participant

    It’s the strangest thing, I’m submitting to the form but not receiving it … I submitted at 12:26 it’s 1:45 … still nothing.

    #73795
    rkacenski
    Member

    Then its most likely your web host. What web host do you have and what email service does email use (i.e. Google Apps).

    #73797
    tannercampbell
    Participant

    GoDaddy (dedicated) standard smtp

    #73768
    rkacenski
    Member

    Hmm ya I’ve have had problems in the past with their mail servers. Not much more I can help you with, I would suggest contacting support good luck.

    #73758
    tannercampbell
    Participant

    I’ve actually plugged my MailChimp’s form action into my html form action — seems to be doing the trick. Thanks @rkacenski!

    #73711
    rkacenski
    Member

    Ooo great I was gunna suggest MailChimp next, glad I could help.

    #72859
    chrisburton
    Participant

    @Tannercampbell:

    I have had a delay issue ever since I started using my domain email with Gmail. Yesterday, I was trying to find a solution again on google and randomly came across a screencast from Chris.

    Question: Are you using Gmail to receive email on your custom domain?

    #72713
    chrisburton
    Participant

    I started importing mine on my regular gmail account and for whatever reason it would delay by sometimes over an hour. I stopped importing, signed up to google apps, went through the process including updating my MX records and it solved the issue completely.

    Incase anyone else has this issue

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘Back End’ is closed to new topics and replies.