Jump to content

BMadden

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by BMadden

  1. Hi I am a newbie with PHP. I created a contact form following a tutorial online and have uploaded the index.html and contact-form.php form to a server with php enabled. I am getting an error message Warning! Please fill all the fields. ”; } else { mail($to,$subject,$msg,”From:”.$email); echo “ I am wondering if anyone can advise me? The PHP: <?php $to="calming1@yahoo.co.uk";/*Your Email*/ $subject="Message from the website"; $date=date("l, F jS, Y"); $time=date("h:i A"); $name=$_REQUEST['name']; $email=$_REQUEST['email']; $message=$_REQUEST['message']; $msg=" Message sent from website form on date $date, hour: $time.\n Name: $name\n Email: $email\n Message: $message\n "; if($email=="") { echo "<div class='alert alert-danger'> <a class='close' data-dismiss='alert'>×</a> <strong>Warning!</strong> Please fill all the fields. </div>"; } else { mail($to,$subject,$msg,"From:".$email); echo "<div class='alert alert-success'> <a class='close' data-dismiss='alert'>×</a> <strong>Thank you for your message!</strong> </div>"; } ?> HTML <form id="contact" class="form-inline" action="contact-form.php" method="post" accept-charset="utf-8"> <div class="form-group pull-left"> <label class="sr-only" for="name">Name</label> <input type="text" class="form-control" id="name" placeholder="Name" name="name"> </div> <div class="form-group pull-right"> <label class="sr-only" for="email">Email</label> <input type="email" class="form-control" id="email" placeholder="Email" name="email"> </div> <textarea class="form-control pull-left" rows="8" placeholder="Message" name="message"></textarea> <button type="submit" class="btn pull-right">Send email</button> </form>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.