Simple sign up form not working

Discussing Html . Code , Software , other

Moderators: egami, macek, gesf

Post Reply
cincihal
New php-forum User
New php-forum User
Posts: 12
Joined: Thu May 31, 2012 7:45 am

Wed Feb 10, 2016 4:54 pm

I have a simple sign up form that is not working. I have not done a lot of PHP, so it is probably some basic mistake. could someone please take a look?

This is the form part of the Html:

Code: Select all

<form id="signup-form" method="post" action="mail.php">
	<input type="text" name="name" id="name" placeholder="Full Name" />			
	<input type="email" name="email" id="email" placeholder="Email Address" />
	<input type="submit" value="Send" />
</form>
mail.php:

Code: Select all

<?php 
$name = $_POST['name'];
$email = $_POST['email'];
$formcontent="From: $name";
$recipient = "mail@mydomain.com";
$subject = "Karl's Sign Up";
$mailheader = "From: $email \r\n";
$mailheader .= "Reply-To: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>

User avatar
j4012345
New php-forum User
New php-forum User
Posts: 21
Joined: Sun Feb 14, 2016 10:57 am

Sun Feb 14, 2016 11:50 am

Code: Select all

<?php 
$name = $_POST['name'];
$email = $_POST['email'];
$formcontent="From: $name";
$recipient = "mail@mydomain.com";
$subject = "Karl's Sign Up";
$mailheader = "From: $email \r\n";
$mailheader .= "Reply-To: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
What errors do you receive after the form is submitted?

Post Reply