HTML Forms

Discussion in 'Web Design and Development' started by 0penCr8, Jul 25, 2012.

  1. 0penCr8 macrumors newbie

    Joined:
    Jul 8, 2012
    Location:
    California, USA
    #1
    I am not very good with HTML and have basically no knowledge of PHP, JavaScript, MySQL, etc... I am trying to create a form for my website. I used to use a great program called CoffeeCup Web Form Builder. Unfortunately, I found out that is t was discontinued and replaced by Web Form Builder 2.0. Now, Web Form Builder 2.0 is great, but it costs $69. I don't really want to spend money on this when I know I can build one for cheaper. I have read through the W3schools.com 'walkthrough' on HTML forms, but they don't look very good and they don't cover everything.

    If someone could send me a link to a thorough tutorial or some well-built freeware, it would be greatly appreciated.
    Thanks.
     
  2. firedept macrumors 603

    firedept

    Joined:
    Jul 8, 2011
    Location:
    Somewhere!
    #2
    Just search 'web form builder' and you will get plenty of results.
     
  3. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
  4. 618537 Guest

    Joined:
    Sep 21, 2011
    #4
  5. mikelegacy, Jul 26, 2012
    Last edited: Aug 6, 2012

    mikelegacy macrumors 65816

    mikelegacy

    Joined:
    Dec 5, 2010
    Location:
    Pittsburgh, PA
    #5
    It's incredibly easy to make a php web form if all you are doing is creating a contact form. Just create the form in HTML:
    Code:
    <form action="sendmail.php" method="post">
    Name: <input type="text" name="name" /><br />
    Email: <input type="text" name="email" /><br />
    Comments: <textarea rows="2" Cols="20" name="comments"></textarea>
     <input type="submit" value="Submit" />
    </form>

    Then create a new page called "sendmail.php" and put this in it:
    PHP:
    <?
    $email $_POST['email'] ;
    $message $_POST['name'] ;
    $message = .$_POST['comments'] ;
    mail"yourname@example.com""Email Subject"$message"From: $email);
    print 
    "Congratulations your email has been sent";
    ?>
    That is CRAZY basic. But it's really not too hard to grasp once you get the hang of it.

    DISCLAIMER: Darth.Titan is the internet police, and would like me to tell you that this is not a best practice, even though I never stated this was the best way to do it, only the easiest. Thank you.
     
  6. 0penCr8 thread starter macrumors newbie

    Joined:
    Jul 8, 2012
    Location:
    California, USA
    #6
  7. Jamesbot macrumors member

    Joined:
    Jun 19, 2009
    #7
    pretty sure you should be using the $_POST array in your php since you're submitting this form as a post ( method="post" ).
     
  8. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #8
    Then you obviously don't have the hang of it yet.

    Like jamesbot noted, you're trying to access $_POST variables with $_GET. You also did no sanitation of the user input whatsoever. You just plugged the input into mail() and fired away. That's terrible practice.

    You also left out several of the mail headers that should be included. That message will be more likely to be caught by a spam filter than to arrive at its intended destination.

    If you're going to try to give potential programmers a hand, show them good code.
     
  9. mikelegacy macrumors 65816

    mikelegacy

    Joined:
    Dec 5, 2010
    Location:
    Pittsburgh, PA
    #9
    As I said, it's INCREDIBLY basic, and big deal, I forgot to change GET to POST on the code I copied. I threw that it in there from a website, without even looking at it.

    Also, where in my post did I say this was best practice OR that he should use my exact solution.

    And like he is going to understand form sanitation? From the sounds of it, he doesn't require anything that needs really any security anyways.

    He asked how to send mail, not how to sanitize forms, dodge spam filters, etc.

    You can sit there and be a dick all you want, but I gave a basic answer for a basic question.

    But if it gets your incredibly small panties out of a bunch, I'll put in my post that it isn't a "best practice". Which I was aware of from the beginning. But going on here giving links to someone to like the SendMail plugin is going to do nothing but overwhelm and confuse.
     

Share This Page