Hey guys,
I am working on my contact form for a site of mine (i am designing the form differently) that is for a child care, and I can't seem to get the form to connect with the php in order to get it to send verification to the user, send me a copy, and record it within a csv.

Here is the html form that goes on the page:

                            <form action="#" class="footer-form" action="contact.php"> <p class="title">Feel free to write some words</p> <div class="form-group"> <strong><input type="text" class="form-control" id="contactname" id="contact-name" placeholder="Your Name:"></strong> </div> <div class="form-group"> <strong><input type="email" class="form-control" id="contactemail" id="contact-email" placeholder="Your E-mail:"></strong> </div> <div class="form-group"> <strong><input type="phone" class="form-control" id="contactphone" id="contact-phone" placeholder="Your Phone Number:"></strong> </div> <div class="form-group"> <strong> <input type="child_info" class="form-control" id="child_info" id="contact-text" placeholder="Information About Child:"></strong> </div> <div class="form-group" style="border-bottom: 1px solid #e5e5e5;"> <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong> <strong style="color: #888;"><input type="radio" id="maLe" name="male" value="male"> Male</strong>   
                                <strong style="color: #888;"><input type="radio" id="female" name="female" value="female"> Female</strong> </div> <div class="form-group" > <strong> <input type="age" id="age" class="form-control" id="contact-text" placeholder="Age of Child:"></strong> </div> <div class="form-group" style="border-bottom: 1px solid #e5e5e5;"> <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> <strong style="color: #888;"><input id="yes"" type="radio" name="yes" value="yes"> Yes</strong>   
                                <strong style="color: #888;"><input id="no" type="radio" name="no" value="no"> No</strong> </div> <div class="form-group"> <strong> <input type="comment" class="form-control" id="message" id="contact-text" placeholder="Comments about service or if you want to add another child, write here:"></strong> </div> <button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button> </form>

Here is the PHP that does all the heavy liftin':

<?php 
    $contactname = $_POST["contact-name"];
    $contactemail = $_POST["contact-email"];
    $contactphone = $_POST["contact-phone"];
    $child_info = $_POST["child_info"];
    $gender = $_POST["gender"];
    $age = $_POST["age"];
    $specialneeds = $_POST["specialneeds"];   
    $message = $_POST["message"];
    $to      = 'yahoo@gmail.com';
    $subject = 'Contact Form Submission!';

    $v1 = "
            <html> <body> <style>
                h1 {color:#000066;}
                table {border:1px solid black; background: #e3f0ff;}
            </style> <h1>Hello, this form has been submitted!</h1> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td><strong>First Name:</strong> $name</td> <tr style='background: #fafafa;'><td><strong>Email:</strong> $email</td> <tr style='background: #fafafa;'><td><strong>Phone:</strong> $phone</td> <tr style='background: #fafafa;'><td><strong>Child Gender:</strong> $gender</td> <tr style='background: #fafafa;'><td><strong>Child's Age::</strong> $age </td> <tr style='background: #fafafa;'><td><strong>Child with Special Needs:</strong> $specialneeds</td> <tr style='background: #fafafa;'><td><strong>More Information:</strong> $message</td> </table> </body> </html> ";
    $message = $v1; 
    $headers  = "From: $from\r\n"; 
    $headers .= "Content-type: text/html\r\n"; 
    mail($to, $subject, $message, $headers); 
    echo "Message has been sent..."; //Page RE DIRECT 
    echo $v1;
//******************************************************************************************************************************//

    $contactname = $_POST["contact-name"];
    $contactemail = $_POST["contact-email"];
    $contactphone = $_POST["contact-phone"];
    $child_info = $_POST["child_info"];
    $gender = $_POST["gender"];
    $age = $_POST["age"];
    $specialneeds = $_POST["specialneeds"];   
    $message = $_POST["message"];
    $subject = 'Message Confirmed!';
    $v1 = "
            <html> <body> <style>
                #disclosure {font-size: 8px; color: #333;}
                h1 {color:#000066;}
                table {border:1px solid black;}
            </style> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td><strong>Email Confirmation</strong> <tr style='background: #fafafa;'><td>Hello <strong> $name</strong>, your message has been recieved! We will contact you shortly! <br><br>Best, <br>M<br>©M™ All Rights Reserved 2015 </div> </table> </body> </html> ";
    $headers  = "From: $from\r\n"; 
    $headers .= "Content-type: text/html\r\n"; 
     mail($email, $subject, $message, $headers);    

      $count= count(file("main_form.csv"));                       
        $today = date("d M Y h:i A");
        echo $today;
        echo $v1;

$cvsData = "\n" . $count . "," . $today . "," . $contactname . "," . $contactemail . "," . $contactphone . "," . $child_info . "," . $gender . "," . "," . $age . "," . $specialneeds . "," . $message;

 $fp = fopen("main_form.csv", "a" );
 if($fp){
     fwrite($fp, $cvsData);
     fclose($fp);
     }                   

?>

Thanks in advance :)

You have two action attribues in your form tag - is that right?

Here are some of the problems I notice immediately.

  • Like Dave already mentioned, there are two actions on your form element.
  • A form method needs to be set to POST.
  • There are two ID's on the form elements. One of them should be name.
  • All radio buttons can be selected (example: gender). If you only want one to be selected at any time, then they need to have the same name (example: name="gender").
  • Get rid of all the inline css and "strong" tags from your markup, and use an external style sheet with selectors on your elements.
  • Do form validation on frontend AND backend. Anyone can turn off JavaScript and bypass your frontend validation. As it currently is, this form can be hijacked very easily to send out spam emails from the website.
  • Why are variables in the PHP being set more than once with the same value? Should only need to set it once.

Contact forms can seem simple enough, but there one of the most commonly exploited features on websites. From hijacking the form and sending out spam from your domain, to injecting harmful code into the form to compromise the files on the server. Taking user input and writing it directly to a file can turn out to be a bad thing, so you'll want to be careful with that. If it's not completely necessary, I would discard that part from the code.

You might also want to concider using a library for this that already exists. An example of one of the more popular ones is PHPMailer

Member Avatar for diafol

SO your markup is like this...

<form action="#" class="footer-form" action="contact.php">
    <p class="title">Feel free to write some words</p>

    <div class="form-group">
        <strong>
            <input type="text" class="form-control" id="contactname" id="contact-name" placeholder="Your Name:">
        </strong>
    </div>
    <div class="form-group">
        <strong>
            <input type="email" class="form-control" id="contactemail" id="contact-email" placeholder="Your E-mail:">
        </strong>
    </div>
    <div class="form-group">
        <strong>
            <input type="phone" class="form-control" id="contactphone" id="contact-phone" placeholder="Your Phone Number:">
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="child_info" class="form-control" id="child_info" id="contact-text" placeholder="Information About Child:">
        </strong>
    </div>
    <div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
        <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong>
        <strong style="color: #888;">
            <input type="radio" id="maLe" name="male" value="male"> Male
        </strong>
        <strong style="color: #888;">
            <input type="radio" id="female" name="female" value="female"> Female
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="age" id="age" class="form-control" id="contact-text" placeholder="Age of Child:">
        </strong>
    </div>
    <div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
        <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
        <strong style="color: #888;">
            <input id="yes"" type="radio" name="yes" value="yes">Yes
        </strong>
        <strong style="color: #888;">
            <input id="no" type="radio" name="no" value="no"> No
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="comment" class="form-control" id="message" id="contact-text" placeholder="Comments about service or if you want to add another child, write here:">
        </strong>
    </div>
    <button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button>
</form>

Try indenting next time - I don't know anybody that can read all that markup in one simple paragraph withoout linebreaks.

Sorry about the formatting, i didn't realize it until now. It was perfectly fine till i posted it on the editor here :P
I will see if i can make some changes based on what you guys have said

Form security is pretty important and is something I have to implement. I would use phpmailer but I am not really sure how to use it.

Based on my current form:
HTML:

<form action="contact.php" class="footer-form">
    <p class="title">Feel free to write some words</p>

    <div class="form-group">
        <strong>
            <input type="text" class="form-control" name="contactname" id="contact-name" placeholder="Your Name:">
        </strong>
    </div>
    <div class="form-group">
        <strong>
            <input type="email" class="form-control" name="contactemail" id="contact-email" placeholder="Your E-mail:">
        </strong>
    </div>
    <div class="form-group">
        <strong>
            <input type="phone" class="form-control" name="contactphone" id="contact-phone" placeholder="Your Phone Number:">
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="child_info" class="form-control" name="child_info" id="contact-text" placeholder="Information About Child:">
        </strong>
    </div>
    <div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
        <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong>
        <strong style="color: #888;">
            <input type="radio" id="maLe" name="gender" value="male"> Male
        </strong>
        <strong style="color: #888;">
            <input type="radio" id="female" name="gender" value="female"> Female
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="age" name="age" class="form-control" id="contact-text" placeholder="Age of Child:">
        </strong>
    </div>
    <div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
        <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
        <strong style="color: #888;">
            <input id="yes"" type="radio" name="specialneeds" value="yes">Yes
        </strong>
        <strong style="color: #888;">
            <input id="no" type="radio" name="specialneeds" value="no"> No
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="comment" class="form-control" id="message" id="contact-text" placeholder="Comments about service or if you want to add another child, write here:">
        </strong>
    </div>
    <button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button>
</form>

The PHP is the same as above:

<?php 
    $contactname = $_POST["contact-name"];
    $contactemail = $_POST["contact-email"];
    $contactphone = $_POST["contact-phone"];
    $child_info = $_POST["child_info"];
    $gender = $_POST["gender"];
    $age = $_POST["age"];
    $specialneeds = $_POST["specialneeds"];   
    $message = $_POST["message"];
    $to      = 'yahoo@gmail.com';
    $subject = 'Contact Form Submission!';

    $v1 = "
            <html> <body> <style>
                h1 {color:#000066;}
                table {border:1px solid black; background: #e3f0ff;}
            </style> <h1>Hello, this form has been submitted!</h1> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td><strong>First Name:</strong> $name</td> <tr style='background: #fafafa;'><td><strong>Email:</strong> $email</td> <tr style='background: #fafafa;'><td><strong>Phone:</strong> $phone</td> <tr style='background: #fafafa;'><td><strong>Child Gender:</strong> $gender</td> <tr style='background: #fafafa;'><td><strong>Child's Age::</strong> $age </td> <tr style='background: #fafafa;'><td><strong>Child with Special Needs:</strong> $specialneeds</td> <tr style='background: #fafafa;'><td><strong>More Information:</strong> $message</td> </table> </body> </html> ";
    $message = $v1; 
    $headers  = "From: $from\r\n"; 
    $headers .= "Content-type: text/html\r\n"; 
    mail($to, $subject, $message, $headers); 
    echo "Message has been sent..."; //Page RE DIRECT 
    echo $v1;
//******************************************************************************************************************************//

    $contactname = $_POST["contact-name"];
    $contactemail = $_POST["contact-email"];
    $contactphone = $_POST["contact-phone"];
    $child_info = $_POST["child_info"];
    $gender = $_POST["gender"];
    $age = $_POST["age"];
    $specialneeds = $_POST["specialneeds"];   
    $message = $_POST["message"];
    $subject = 'Message Confirmed!';
    $v1 = "
            <html> <body> <style>
                #disclosure {font-size: 8px; color: #333;}
                h1 {color:#000066;}
                table {border:1px solid black;}
            </style> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td><strong>Email Confirmation</strong> <tr style='background: #fafafa;'><td>Hello <strong> $name</strong>, your message has been recieved! We will contact you shortly! <br><br>Best, <br>M<br>©M(TM) All Rights Reserved 2015 </div> </table> </body> </html> ";
    $headers  = "From: $from\r\n"; 
    $headers .= "Content-type: text/html\r\n"; 
     mail($email, $subject, $message, $headers);    

      $count= count(file("main_form.csv"));                       
        $today = date("d M Y h:i A");
        echo $today;
        echo $v1;

$cvsData = "\n" . $count . "," . $today . "," . $contactname . "," . $contactemail . "," . $contactphone . "," . $child_info . "," . $gender . "," . "," . $age . "," . $specialneeds . "," . $message;

 $fp = fopen("main_form.csv", "a" );
 if($fp){
     fwrite($fp, $cvsData);
     fclose($fp);
     }                   

?>

The form "seems" like its responding. It goes through and submits the form and sends me a verification that someone did, but the user who submitted it doesn't get a verification that their form was submitted. And when I look in the .csv file, I see this instead of the desired inputs: Screen_Shot_2015-06-07_at_11.35_.40_AM_.png

Also, when I recieve the email that it went through, I don't see the inputs I needed to see:
Screen_Shot_2015-06-07_at_11.41_.55_AM_.png

I think that after I get this form to work correctly, I am going to add security into it and also, I want it to look much more "friendly" for the user that submits it because as soon as they submit it, they see a glimpse of the php form that gets sent for a split second before the page gets refreshed and sends them to the top.

The forms POST data is in the "name" attributes value, not the ID.
You need to either swap the ID and name values, or change the POST variables names in the PHP.

So by doing something like this:
HTML (before):
<input type="text" class="form-control" name="contactname" id="contact-name" placeholder="Your Name:">

After:
<input type="text" class="form-control" name="contact-name" id="contactname" placeholder="Your Name:">

Member Avatar for diafol

Sorry, not being funny <M/>, but did you really post that last question? Did you not think to test it first?

I usually make it a rule of thumb to keep 'name' and 'id' the same if possible to avoid this confusion, as sometimes you want to lever some ajax goodness out of forms, wheree you may be using 'id' instead of 'name'. Is there any reason for the difference?

Sorry Diafol, things have been pretty "off" for me lately and I haven't been writing or practicing much due to finals that are coming up before the end of school :P

I usually make it a rule of thumb to keep 'name' and 'id' the same if possible to avoid this confusion, as sometimes you want to lever some ajax goodness out of forms, wheree you may be using 'id' instead of 'name'. Is there any reason for the difference?

I did it the way I did because I assumed (for whatever random reason I had) that it can work because it did before in the past with a different site I was practicing on.

Did you not think to test it first?

No, not while I was using my phone at that moment.

Alright, I am back reviving this thread...

So, I have made a few tweaks to the form. Currently, the only thing that works is that it sends me an email that someone submitted the form. What doesn't work is that I can't see what they submitted, the user who submitted it doesn't get a verification, and the results don't get recorded in my csv file.

Here is the current progress (i removed the extra ID tags):

HTML:

<form action="contact.php" class="footer-form" method="post">
<p class="title">Feel free to write some words</p>

<div class="form-group">
    <strong>
        <input type="text" class="form-control" id="contact-name" placeholder="Your Name:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="email" class="form-control"  id="contact-email" placeholder="Your E-mail:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="phone" class="form-control" id="contact-phone" placeholder="Your Phone Number:">
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="child_info" class="form-control" id="child_info" placeholder="Information About Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong>
    <strong style="color: #888;">
        <input type="radio" id="maLe" name="male" value="male"> Male
    </strong>
    <strong style="color: #888;">
        <input type="radio" id="female" name="female" value="female"> Female
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="age" id="age" class="form-control" placeholder="Age of Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
    <strong style="color: #888;">
        <input id="yes"" type="radio" name="yes" value="yes">Yes
    </strong>
    <strong style="color: #888;">
        <input id="no" type="radio" name="no" value="no"> No
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="comment" class="form-control" id="message" placeholder="Comments about service or if you want to add another child, write here:">
    </strong>
</div>
<button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button>

PHP:

<?php 
        $contactname = $_POST["contact-name"];
        $contactemail = $_POST["contact-email"];
        $contactphone = $_POST["contact-phone"];
        $child_info = $_POST["child_info"];
        $gender = $_POST["gender"];
        $age = $_POST["age"];
        $specialneeds = $_POST["specialneeds"];   
        $message = $_POST["message"];
        $to      = 'yahoo@gmail.com';
        $subject = 'Contact Form Submission!';

        $v1 = "
                <html> <body> <style>
                    h1 {color:#000066;}
                    table {border:1px solid black; background: #e3f0ff;}
                </style> <h1>Hello, this form has been submitted!</h1> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td>First Name: $name</td> <tr style='background: #fafafa;'><td>Email: $email</td> <tr style='background: #fafafa;'><td>Phone: $phone</td> <tr style='background: #fafafa;'><td>Child Gender: $gender</td> <tr style='background: #fafafa;'><td>Child's Age: $age </td> <tr style='background: #fafafa;'><td>Child with Special Needs: $specialneeds</td> <tr style='background: #fafafa;'><td>More Information: $message</td> </table> </body> </html> ";
        $message = $v1; 
        $headers  = "From: $from\r\n"; 
        $headers .= "Content-type: text/html\r\n"; 
        mail($to, $subject, $message, $headers); 
        echo "Message has been sent..."; //Page RE DIRECT 
        echo $v1;
    //******************************************************************************************************************************//

        $contactname = $_POST["contact-name"];
        $contactemail = $_POST["contact-email"];
        $contactphone = $_POST["contact-phone"];
        $child_info = $_POST["child_info"];
        $gender = $_POST["gender"];
        $age = $_POST["age"];
        $specialneeds = $_POST["specialneeds"];   
        $message = $_POST["message"];
        $subject = 'Message Confirmed!';
        $v1 = "
                <html> <body> <style>
                    #disclosure {font-size: 8px; color: #333;}
                    h1 {color:#000066;}
                    table {border:1px solid black;}
                </style> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td>Email Confirmation <tr style='background: #fafafa;'><td>Hello  $name, your message has been recieved! We will contact you shortly! <br><br>Best, <br>M<br>©M(TM) All Rights Reserved 2015 </div> </table> </body> </html> ";
        $headers  = "From: $from\r\n"; 
        $headers .= "Content-type: text/html\r\n"; 
         mail($email, $subject, $message, $headers);    

          $count= count(file("main_form.csv"));                       
            $today = date("d M Y h:i A");
            echo $today;
            echo $v1;

    $cvsData = "\n" . $count . "," . $today . "," . $contactname . "," . $contactemail . "," . $contactphone . "," . $child_info . "," . $gender . "," . "," . $age . "," . $specialneeds . "," . $message;

     $fp = fopen("main_form.csv", "a" );
     if($fp){
         fwrite($fp, $cvsData);
         fclose($fp);
         }                   

    ?>

Thanks for the help so far guys, I know my work is a mess but eventually I can catch up and get things in order again. :)

Member Avatar for diafol

I see a number of issues here M.

<input id="yes"" type="radio" name="yes" value="yes">Yes

Has an additional double quote after "yes".
The name attribute for optionbuttons should be the same e.g. name="specialneeds" instead of name="yes" and name="no" - otherwise checking one will not uncheck the other and vice versa. So to my mind, it should be:

<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
    <strong style="color: #888;">
        <input id="yes" type="radio" name="specialneeds" value="yes">Yes
    </strong>
    <strong style="color: #888;">
        <input id="no" type="radio" name="specialneeds" value="no"> No
    </strong>
</div>

In addition, you should place styling into a CSS file rather than have inline styling. Inline styling has highest priority, so trying to override it later on in a CSS file is problematic. The last thing you want to do is mess around with your markup in order to change styling - arduous. Make the markup as lean as possible - it'll be far more readable and maintainable. Inline styling is fine for prototyping, but move it into CSS (or at least into a head style section [temporarily]) once you get it looking as you want.

Again, the same this for gender section - use the name="gender" if you can.

Other fields in your form have missing name attributes, but you seem to have retained ids. This is OK if you're using Ajax, but not if you're using traditional form submit. Seems you got it the wrong way round.

That's it for now after a quick look. Sorry didn't touch on csv etc, but it may explain missing post data.

Hmm, okay.
I tend to prefer at times to use inline styling to overwrite a css I did. Is it the best approach? Of course not. Do I like it for no reason? Yeah :P

I added some name attributes and this is what I have so far (hopefully it looks good :P):

<form action="contact.php" class="footer-form" method="post">
<p class="title">Feel free to write some words</p>

<div class="form-group">
    <strong>
        <input type="text" class="form-control" name="contact-name" id="contact-name" placeholder="Your Name:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="email" class="form-control" name="contact-email"" id="contact-email" placeholder="Your E-mail:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="phone" class="form-control" name="contact-phone" id="contact-phone" placeholder="Your Phone Number:">
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="child_info" class="form-control" name="child_info" id="child_info" placeholder="Information About Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" name="gender" id="gender">Child's Gender:</strong>
    <strong style="color: #888;">
        <input type="radio" id="gender" name="male" value="male"> Male
    </strong>
    <strong style="color: #888;">
        <input type="radio" id="gender" name="female" value="female"> Female
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="age" name="age" id="age" class="form-control" placeholder="Age of Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
    <strong style="color: #888;">
        <input id="yes" type="radio" name="specialneeds" value="yes">Yes
    </strong>
    <strong style="color: #888;">
        <input id="no" type="radio" name="specialneeds" value="no"> No
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="comment" class="form-control" name="message" id="message" placeholder="Comments about service or if you want to add another child, write here:">
    </strong>
</div>
<button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button>

Okay, so I am starting to see some progress when having it set up like that. Atm, I do get what the user submitted, but only half of it (view image). Currently, I don't get half of the inputs, the user doesn't get a verification, and the csv isn't recieving any inputs.
Screen_Shot_2015-06-24_at_9.52_.06_AM_.png

Member Avatar for diafol

I don't know what editor you're using, but it's not working for you. Double double quotes on email name attribute.

Gender options not changed. You give strong tag an id and name of gender. Not sure why you'd do this.

Gender id down 3 times. Each id should be unique.

Losing the will here M. Some of these issues have been covered already. Ok leaving you to it.

Sorry Diafol, I am using Coda as the editor. It does a poor job of telling me about errors :/

Let me see if Dreamweaver can do things better than Coda

Losing the will here M. Some of these issues have been covered already. Ok leaving you to it.

I don't blame you, I am a mess at the moment and I need to get things straightened up to where I was last summer. But I do appreciate your help!

Out of curiousity, what would be the most preferred editor for catching mistakes like the ones I am making? Coda 2 doesn't do the job, even though its a nice looking editor...

Member Avatar for diafol

Search this forum - we had a discussion about it recently. Sublime, PHPStorm and a few others seemed to be popular. You gotta try them out yourself though.

I am gonna go check out PHPStorm, hopefully that will be pretty good.

You know what, I think I figured out why I had a problem the entire time. My php variables didn't match what I had in the HTML file because of what I changed - diafol face atm after reading it until this far: :D . I finally got it to send me verifications and send me a copy of what they sent. I just need to clean it up... a lot.

Hmm, I need to add some form security. What do you guys think is the best approach since I don't need a very advanced form security?

Member Avatar for diafol

WHy do you not want advanced security? CSRF token. Captcha.

I wasn't considering something very advanced because its a pretty basic site and the main source of contacting is through a phone call. The contact form is an optional thing, but I guess i will just implement captcha then.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.