php login script doesn't do anything (Dreamweaver generated)
<p>I have a working php server and mysql database. Used Dreamweaver to generate a login script but it doesn't work, after hitting submit it reloads the current page. Either way, in success or failure it should change pages. Any ideas?</p>

<p>I solved it, needed to make sure the id and class of the input were different. Once different it worked.</p>

<pre><code>&lt;?php require_once('Connections/Connection.php'); ?&gt;
&lt;?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['emailField'])) {
  $loginUsername=$_POST['emailField'];
  $password=$_POST['passwordField'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "main.php";
  $MM_redirectLoginFailed = "login_failed.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_Connection, $Connection);

  $LoginRS__query=sprintf("SELECT email, password FROM customer WHERE email=%s AND password=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 

  $LoginRS = mysql_query($LoginRS__query, $Connection) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";

    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;       

    if (isset($_SESSION['PrevUrl']) &amp;&amp; false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; 
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?&gt;

&lt;form ACTION="&lt;?php echo $loginFormAction; ?&gt;" METHOD="POST" name="login"&gt;
       &lt;input type="text" id="emailField" class="emailField" /&gt;
     &lt;input type="password" id="passwordField" class="passwordField" /&gt;
       &lt;input type="submit" id="sendButton" value="Send" class="sendButton" /&gt;
      &lt;/form&gt;

CONNECTION.PHP
&lt;?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Connection = "localhost";
$database_Connection = "db";
$username_Connection = "test";
$password_Connection = "password";
$Connection = mysql_pconnect($hostname_Connection, $username_Connection, $password_Connection) or trigger_error(mysql_error(),E_USER_ERROR); 
?&gt;
</code></pre>
