title: PHP Delete User Script
body: <p>I have created this script called urmusers.php, however I get an unexpected end of file error. I am a noobie to PHP and just started learning it recently. Could anyone please look at my code and tell me what is wrong with it? I would greatly appreciate it. I also understand that mysql_* is depreciated but for the purpose of my little project it does not matter as this will not be used in a live environment but for testing purposes only.</p>
  
  <p>The scrip is as follows:</p>
  
  <pre><code>&lt;?php
  
  $mysql_hostname = "localhost";
  $mysql_user = "root";
  $mysql_password = "newman13";
  $mysql_database = "ninjaz_gaming";
  $prefix = "";
  $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
  mysql_select_db($mysql_database, $bd) or die("Could not select database");
  
  $id = get_post('id');
  $name = get_post('name');
  $email = get_post('email');
  $ircts3 = get_post('ircts3');
  $game = get_post('game');
  
  if (isset($_POST['delete']) &amp;&amp; $id != "")
  {
  $query = "DELETE FROM Users WHERE id='$id'";
  
  if (!mysql_query($query, $bd))
  {
  echo "DELETE failed: $query&lt;br /&gt;" .
  mysql_error() . "&lt;br /&gt;&lt;br /&gt;";
  }
  else
  {
  for ($j = 0 ; $j &lt; $rows ; ++$j)
  $row = mysql_fetch_row($result);
  echo &lt;&lt;&lt;_END
  &lt;pre&gt;
  Id $row[0]
  Name $row[9]
  Email $row[3]
  IRCTS3 $row[6]
  Fav Game $row[7]
  &lt;/pre&gt; 
  }
  &lt;form action="urmuser.php" method="post"&gt;
  &lt;input type="hidden" name="delete" value="yes" /&gt;
  &lt;input type="hidden" name="id" value="$row[0]" /&gt;
  &lt;input type="submit" value="DELETE USER" /&gt;&lt;/form&gt;
  _END;
  
  }
  mysql_close($bd);
  function get_post($var)
  {
  return mysql_real_escape_string($_POST[$var]);
  }
  ?&gt;
  </code></pre>