0

I have a problem with isset. What I want is some echos after getting, checking and initialising the values from isset. it doesn't work. I don't see any reason behind this. It only refreshes the page after submitting the form.

Below is the code

<?php
if  (isset($_post['contact_name'] )  &&  isset($_post['contact_email'])  &&  isset($_post['contact_text']))
{

 echo  $contact_name = $_post["contact_name"];
 echo  $contact_email = $_post['contact_email'];
  echo  $contact_text =   $_post['contact_text'];
   //!empty($_post['contact_name'])
       //echo 'no value submit';

  if(!empty($contact_name)  &&  !empty($contact_email) &&  !empty($contact_text))
  {
      echo 'ok';

  }
  else
  {
      echo 'all fildes required !!!!!!!!!!!!!';
}

}

?>
<html>
<form action="index.php" method="post">
     name : <br> <input type="text" name="contact_name" ><br><br>
     Email address : <br> <input type="text"  name= "contact_email "><br><br>
     Message :<br><textarea name="contact_text"  rows="6" cols="30" type="text" ></textarea><br><br>
     <input type="submit" value="send">

</form>  
</html>
JochenJung
  • 7,183
  • 12
  • 64
  • 113

2 Answers2

0

Use $_POST instead of $_post. Hope this will work.

Maciej Treder
  • 11,866
  • 5
  • 51
  • 74
Asif AR
  • 9
  • 2
0

You need to use this;

<?php
if  (isset($_POST['contact_name'] )  &&  isset($_POST['contact_email'])  &&  isset($_POST['contact_text']))
{
...
statistic
  • 162
  • 1
  • 13