Question: ```
<?php
if (isset($_POST['ign'], $_POST['email'])) {
    if($_POST['ign'] && $_POST['email']){

    }
    else {
        echo ("Please enter all of the values!");
    }
}
else {
    echo ("Error in form data!");
}
if((FILTER_VALIDATE_EMAIL($_POST['email'] == TRUE))) {
    $email = $_POST['email'];
    echo ("Thanks, " . htmlentities($_POST['ign']) . ", you will recieve an email when the site is complete!");
}
else {
    echo "Failure!";
}

// insert email and ign into database
?>

```

Is this going to work correctly? First time doing something completely from scratch lol!

OK! I have changed it. What about this? Should I also do the empty thing?

```
<?php
if (!isset($_POST['ign'], $_POST['email'])) {
    if($_POST['ign'] && $_POST['email']){
    echo "Please fill out all of the fields!";
        die;
}
if(var_filter($_POST['email'], FILTER_VALIDATE_EMAIL))
    $email = $_POST['email'];
    echo ("Thanks, " . htmlentities($_POST['ign']) . ", you will recieve an email when the site is complete!");
}
else {
    echo "Your email was invalid!";
}

// insert email and ign into database
?>

```

Answer: 
Try checking if POST params are set :

```
 <?php

if($_POST) {

    $con = mysql_connect("localhost","user","pass") or die ("Couldn't connect!");
    if (!$con)
    {
        die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("streams") or die ("Couldn't find db");

    $sql="INSERT INTO streams (streamname)
    VALUES ('$_POST[streamname]')";

    if (!mysql_query($sql,$con))
    {
        die('Error: ' . mysql_error());
    }

    echo "1 record added";

    mysql_close($con);
}

?>

<form action="submit.php" method="POST">
    Stream Name: <input type="text" name="streamname" id="streamname" /><br />
    <input type="submit" name="submit" value="Stream" />
</form> 

```
You should be escaping the input.

```
$sql='INSERT INTO streams (streamname)
VALUES ("'.mysql_real_escape_string($_POST[streamname]).'")';

```