Form Submission Not Working

Hello, The form I have below is not sending anything when I click submit.

Here is the form:

<div class="form"

I'll attend:   full time   part time

Submit

And here is the PHP for test.php the form is linking to:

<?php // Contact subject $firstname ="$first_name"; // Details $message="$detail"; // Mail of sender $mail_from="$email"; // From $header="from: $first_name <$mail_from>"; // Enter your email address $to ='[email protected]'; $send_contact=mail($to,$firstname,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?>

I know the PHP is not grabbing all form fields I setup. Is there something wrong with the Form code on top: Any help would be appreciated.

Thanks

Of course its not sending anything. There is no code there to send something.

Hi,

There is an important bit missing, therefore:

// Contact subject
$firstname ="$first_name";

should look like :

//Contact subject
$firstname = $_POST[‘first_name’];
or
$firstname = @$_POST[‘first_name’];

More on that here: http://www.w3schools.com/php/php_superglobals.asp

$firstname = @$_POST['first_name'];

ABSOLUTELY NOT! You never suppress errors, you fix them. That is one function that should have been removed in Php7.

Sorry about that - it was meant in case that OP would try to collect data from $_POST before actual form is used (if it makes a sense).
Either way, I believe Kevin is right…

Sponsor our Newsletter | Privacy Policy | Terms of Service