Hi I have the below codes , and for some reason redirects and I get a Undefined variable: subject in C:\wamp\www\boot\send.php on line 42, as below. Appreciate any assistance I can get.
Line 42 is
$go = mail($to, $subject, $body, "From:<$from>");
Contact us
<body>
<div class='formbody'>
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<form id="contact-form" action="send.php" method="POST">
<p>Dear hidden@gmai..com,</p>
<p>My
<label for="your-name">name</label> is
<input type="text" name="your-name" id="your-name" minlength="3" placeholder="(your name here)" required> and</p>
<p>my
<label for="email">email address</label> is
<input type="email" name="your-email" id="email" placeholder="(your email address)" required>
</p>
<p> I have a
<label for="your-message">message</label> for you,</p>
<p>
<textarea name="your-message" id="your-message" placeholder="(your msg here)" class="expanding" required></textarea>
</p>
<p>
<button type="submit">
<svg version="1.1" class="send-icn" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100px" height="36px" viewBox="0 0 100 36" enable-background="new 0 0 100 36" xml:space="preserve">
<path d="M100,0L100,0 M23.8,7.1L100,0L40.9,36l-4.7-7.5L22,34.8l-4-11L0,30.5L16.4,8.7l5.4,15L23,7L23.8,7.1z M16.8,20.4l-1.5-4.3
l-5.1,6.7L16.8,20.4z M34.4,25.4l-8.1-13.1L25,29.6L34.4,25.4z M35.2,13.2l8.1,13.1L70,9.9L35.2,13.2z" />
</svg>
<small>SEND PLEASE</small>
</button>
</p>
</form>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/bs-animation.js"></script>
<script src="assets/js/index.js"></script>
</div>
</body>
Send.php
<?php
$to = "hidden@gmail.com";
$name = TRIM (stripslashes($_POST['your-name']));
$email = TRIM (stripslashes($_POST['your-email']));
$message = TRIM (stripslashes($_POST['your-message']));
$body ="";
$body .="Name: ";
$body .=$name;
$body."
";
$body ="";
$body .="Email: ";
$body .=$email;
$body."
";
$body ="";
$body .="Message: ";
$body .=$message;
$body."
";
$go = mail($to, $subject, $body, "From:<$from>");
if($go) {
print("message sent");
}
else{
print("There has been a small error . Sorry!!");
}
?>