0

I'm making a Register form with PHP and MySQL (PHPMyAdmin), and when I open the page on the browser (Mozilla Firefox), i get

Parse error: syntax error, unexpected $end in line 71

<?php

require('config.php');

if(isset($_POST['submit'])){

    //Verificació
    $email1 = $_POST['email1'];
    $email2 = $_POST['email2'];
    $pass1 = $_POST['pass1'];
    $pass2 = $_POST['pass2'];

    if($email1 == $email2){
        if ($pass1 == $pass2){
            //Tot bé!

            $name = mysql_escape_string($_POST['name']);
            $lname = mysql_escape_string($_POST['lname']);
            $email1 = mysql_escape_string($email1);
            $email2 = mysql_escape_string($email2);
            $pass1 = mysql_escape_string($pass1);
            $pass2 = mysql_escape_string($pass2);



        }else{
            die("Sorry, your passwords didn't match");
        }
    }else{
        die("Sorry, your emails didn't match");
    }


}else{

    echo <<<EOD

    <form action='register.php' method='POST'>
    First name:<input type='text' name='name' /><br/>
    Last name:<input type='text' name='lName' /><br/>
    Username:<input type='text' name='username' /><br/>
    Email:<input type='text' name='email' /><br/>
    Password:<input type='password' name='pass1' /><br/>
    Confirm password:<input type='password' name='pass2' /><br/>
    <input type='submit' value='Register' name='submit' />
    </form>
    EOD;

}

?>

What am I doing bad? Can someone help me please?

Adrià
  • 207
  • 1
  • 4
  • 12

1 Answers1

5

Closing EOD; needs to be at beginnning of the line (not indented by spaces or tabs). See big red warning here: http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

Miro
  • 1,879
  • 14
  • 12