0

Please help me to figure out my error. It seems to be correct but I can't get the values inside my form.

<form action="validate.php" id="form">
      <input type="text" name="email" placeholder="Email" required>
      <input type="text" name="name" class="transparent form-group col-sm-5 col-xs-offset-1" placeholder="Name" required><br>
      <input type="text" name="company" class="transparent form-group col-sm-6" placeholder="Company" required>
      <input type="text" name="contact" class="transparent form-group col-sm-5 col-xs-offset-1" placeholder="Contact No." required>
      <textarea id="message" name="message" placeholder="Message" rows="4" cols="54" required></textarea>   
      <input type="image" src="img/send_btn.png" alt="Submit" class="pull-right">
</form>

validate.php

<?php
$email = $_POST['email'];
$content = $_POST['message'];
$name = $_POST['name'];
$company = $_POST['company'];
$contact = $_POST['contact'];
?>
Shehary
  • 9,926
  • 10
  • 42
  • 71
Danaya
  • 31
  • 4

1 Answers1

3

Your form does not have a "method" specified, and will default to GET. Your validate.php file will only accept methods via POST. Try changing your form definition:

<form action="validate.php" id="form" method="POST">
CollinD
  • 7,304
  • 2
  • 22
  • 45