I'm having a problem for doing my form .
When I click the button generate , I'm attempting to redirect to an error page but it stills redirect to the correct page even in the form it's empty.

```
if(isset($_POST['Generate'])) {
    if(!empty($_POST['aid'])) {
        $gen_link = "www.correctlink.com";
        $_SESSION['active'] = $aid;
        header("Location: http://$gen_link") ;
    } else {
        header("Location : http://error404.com");
    }
}   

```

Even when I click the generate button it stills redirect to www.correctlink.com
I want the user to type something in the form

Form Code:

```
<input type="text" name="aid" id="aid" value="Enter Your Active Here" onfocus=" if (this.value == 'Enter Your Active Here') { this.value = ''; }" onblur="if (this.value == '') { this.value='Enter Your Active Here';}  "/><br /><br />

   <input type="submit" class="button" value="Generate" name="Generate" id="Generate"/>

```