title: Big Issues with getting a profile update page to update the databse
body: <p>I've got a big issue with my website.  I've made a profile page which will allow users to amend their details, and then submit.  Upon submitting the details should be updated in the database, however I just get a blank page and nothing happens.  I've been up for 30+ hours trying to figure things out but no luck.  It's likely to be screwed up, as now is my brain.</p>
  
  <p>Any help would be GREATLY appreciated. </p>
  
  <p>Profile amend page: </p>
  
  <pre><code>&lt;?php 
  session_start();     
  if (!isset($_SESSION['Username'])) {
     echo 'Welcome, '.$_SESSION['Username']; 
  } else {
  echo 'Sorry, You are not logged in.';
  }
  ?&gt;
  
  
   &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Index&lt;/title&gt;
  &lt;link href="External style sheet layout.css" rel="stylesheet" type="text/css" /&gt;
  
  &lt;h1&gt;&lt;?php echo date("D M d, Y G:i a"); ?&gt;
      &lt;?php $welcome = 'Hi';
  if (date("H") &lt; 12) {
      $welcome = 'Good Morning';
  } else if (date('H') &gt; 11 &amp;&amp; date("H") &lt; 18) {
      $welcome = 'Good Afternoon';
  } else if(date('H') &gt; 17) {
      $welcome = 'Good Evening';
  }
  echo $welcome;
  ?&gt;&lt;/h1&gt; 
  
  
   &lt;div class="Login"&gt;
  &lt;h3&gt;&lt;ul&gt;
  &lt;?php if(isset($_SESSION['authenticatedUser']) &amp;&amp; $_SESSION['authenticatedUser'] != null ) {?&gt;
      &lt;li&gt;&lt;a href="Profile.php"&gt;Welcome &lt;?php echo $_SESSION["authenticatedUser"] ?&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="logout.php"&gt;&lt;span&gt;Log Out&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; 
  &lt;?php } else {?&gt; &lt;li&gt;&lt;a href="login.php"&gt;&lt;span&gt;Log In&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php } ?&gt;
  
    &lt;li&gt;&lt;a href="createUser.php"&gt;Register&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;Basket&lt;/a&gt;&lt;/li&gt;
  
  &lt;/ul&gt;&lt;/h3&gt;
  &lt;/div&gt;
  
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="container"&gt;
      &lt;div id="header"&gt;
  
              &lt;img src="Images/Schurter3.jpg" width="800" height="300" alt="Schurter" /&gt;
    &lt;/div&gt;
  &lt;div id="navigation"&gt;
          &lt;ul id="navbar"&gt;
              &lt;li&gt;&lt;a href="Index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="Components.html"&gt;Components&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="Circuit protection.html"&gt;Circuit Protection&lt;/a&gt;
                              &lt;li&gt;&lt;a href="Connectors.html"&gt;Connectors&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="Switches.html"&gt;Switches&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="EMC Products.html"&gt;EMC Products&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="Other Products.html"&gt;Other Products&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                          &lt;/li&gt; 
              &lt;li&gt;&lt;a href="EMS.html"&gt;Electronic Manufacturing Services&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="Application Examples.html"&gt;Application Examples&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="Processes.html"&gt;Processes&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                          &lt;/li&gt; 
              &lt;li&gt;&lt;a href="About.html"&gt;About&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="Contact.php"&gt;Contact&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  
  
  
  &lt;?php
    include 'db.inc';
  
   //Check to see if a customer ID has been passed in the URL 
    $memberID = $_GET["memberID"];
  
    // Has a custID been provided? If so, retrieve the customer
    // details for editing.
    if (!empty($memberID))
    {
        $connection = mysql_connect($hostname, $username, $password) or die ("Unable to connect!"); 
  
  // select database 
        mysql_select_db($databasename) or die ("Unable to select database!"); 
  
        $query = "SELECT * FROM members WHERE id = " . $memberID;
        //Get the recordset
        $recordSet = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 
        $row = mysql_fetch_assoc($recordSet);
        //Check for errors
        //if (!$recordSet) 
        //   print $connection-&gt;ErrorMsg();
        // else
       // {
          // Load all the form variables with customer data
          $Firstname = $row['Firstname'];
          $Surname = $row['Surname'];
          $Emailaddress = $row['Emailaddress'];
          $Username = $row['Username'];
          $Password = $row['Password'];
  
       // }//End else
  }     
  ?&gt;
  
  
  
  
  
  
  
  
      &lt;form name="RegisterForm"  action="ProfileUpdate.php"  method="post" &gt; 
      &lt;input type="hidden" name="memberID" value="&lt;?php echo $memberID;?&gt;"&gt;
  
      &lt;label&gt;First name*&lt;/label&gt;
      &lt;input name="Firstname" placeholder="Enter first name here" value="&lt;?php echo $Firstname;?&gt;" required/&gt; 
  
      &lt;label&gt;Surname*&lt;/label&gt;
      &lt;input name="Surname" placeholder="Enter surname here" value="&lt;?php echo $Surname;?&gt;" required/&gt; 
  
      &lt;label&gt;Email*&lt;/label&gt;
      &lt;input name="Emailaddress" type="email" placeholder="Enter email here" value="&lt;?php echo $Emailaddress;?&gt;" required/&gt; 
  
      &lt;label&gt;Username*&lt;/label&gt;
      &lt;input name="Username" type="text" placeholder="Enter a desired username" value="&lt;?php echo $Username;?&gt;" required/&gt; 
  
      &lt;label&gt;Password*&lt;/label&gt;
      &lt;input name="Password" type="password" placeholder="Enter a desired password" value="&lt;?php echo $Password;?&gt;" required/&gt; 
  
      &lt;input id="submit" name="submit" type="submit" value="Update Details"&gt;
  
  &lt;/form&gt;
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is the update action page:</p>
  
  <pre><code>&lt;?php
   require('db.inc');
  
    $memberID = $_GET["id"];
    echo $memberID;
  
  
  
    // trim the POSTed values - gets rid of unecessary whitespace 
  $Firstname = $_POST['Firstname'];
  $Surname = $_POST['Surname'];
  $Emailaddress = $_POST['Emailaddress'];
  $Username = $_POST['Username'];
  $Password = $_POST['Password'];
    //Here we use validation at the server
    // Vaildate the firstname
  
  
  ?&gt;
  &lt;!DOCTYPE HTML PUBLIC 
     "-//W3C//DTD HTML 4.0 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd" &gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;Customer Details Error&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;  
  &lt;h1&gt;Customer Details Error&lt;/h1&gt;
  &lt;?=$errorString?&gt;
  &lt;br&gt;&lt;a href="ProfileAmend.php"&gt;Return to the customer form&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php      
  
  
     // If we made it here, then the data is valid
  $connection = mysql_connect($hostname, $username, $password) or die ("Unable to connect!"); 
  
  // select database 
  mysql_select_db($databasename) or die ("Unable to select database!");  
  
  //  this is an update
      if (!empty($memberID))
      {
         $query = "UPDATE members SET ". 
          "Firstname = '$Firstname', Surname = '$Surname', " .                    
         "Emailaddress = '$Emailaddress', Username = '$Username', Password = '$Password', " .
         " WHERE id = $memberID";
  
  
          $recordSet = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
  
          echo "Your updates are complete!"; 
       }
  
  ?&gt;
  </code></pre>