Question: I am coding a PHP script, but I can't really seem to get it to work. I am testing out the basics, but I don't really understand what GET and POST means, what's the difference? All the definitions I've seen on the web make not much sense to me, what I've coded so far (but since I don't understand POST and GET, I don't know how to get it to work:

```
    <form name="mail_sub" method="get">
Name: <input type="text" name="theirname"> <br />
Email:&nbsp; <input type="text" name="theirpass"> <br />
<input type="submit" value="Join!" style="width:200px">
</form>
<?php
if (isset($_POST['mail_sub']))
    {

    echo $_POST['theirname'];

    }
?>

```

Answer: 
$\_POST isn't working for you because you have the form method set to get.

```
<form name="mail_sub" method="post">

```

There's plenty of better info online as to the difference between post and get so I won't go into that but this will fix the issue for you.

Change your PHP as well.

```
if ( isset( $_POST['theirname'] ) ) {

    echo $_POST['theirname'];

}

```
GET - If form method is GET then on submitting the form, Form will be submitted to

```
xyz.com/submit.php?theirname=john&theirpass=password   // CHECK HERE - form elements are in URL so not so secure

```

and can be checked by PHP
as 

```
if(isset($_GET['their']))
{
$name=$_GET['their'];  //name will return John
}

```

POST - If form method is POST then on submitting the form, Form will be submitted to

```
xyz.com/submit.php   // CHECK HERE form elements are not in URL

```

and can be checked by PHP
as 

```
if(isset($_POST['their']))
{
$name=$_POST['their'];  //name will return John
} 

```