Parse error: syntax error, unexpected $end in C:\xampp\htdocs\speedyautos\install.php on line 216
<p>where am i making the mistake with my code? please help!</p>

<pre><code>&lt;?php
require_once ("config.php");
require_once ("admincp/install_cls.php");
?&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 lang="en" dir="ltr"&gt;
&lt;head&gt;
&lt;title&gt;&lt;?php echo $name_of_site ?&gt;&lt;/title&gt;

&lt;link href="&lt;?php echo SITE_URL ?&gt;/templates/admin/install.css" rel="stylesheet" type="text/css" /&gt;
&lt;script type="text/javascript" src="&lt;?php echo SITE_URL ?&gt;/templates/admin/install.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;h2 style="margin-left:auto; margin-right:auto; width:75%; text-align:center"&gt;&lt;?php echo $name_of_site ?&gt; Install&lt;/h2&gt;

&lt;?php
define('VERSION', '1.0.8'); // version of script

if (file_exists(FULL_PATH . "/admincp/" . TABLE_PREFIX . "db.php"))
{
                $db = "&lt;div class=\"error\"&gt;" . TABLE_PREFIX . "db.php exits! You will be overwriting this file once you click continue.&lt;/div&gt;";
                $Connection = TRUE;
}
else
{
                $db = "&lt;div class=\"error\"&gt;" . TABLE_PREFIX . "db.php does not exits!&lt;/div&gt;";
                $Connection = FALSE;
}

$level = (isset($_POST['level'])) ? $_POST['level'] : "";
if ($level == "")
{
?&gt;
  &lt;div class="raised" style="text-align:center; margin-right:auto; margin-left:auto"&gt;&lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
    &lt;div class="boxcontent" style="padding:3px"&gt;
         Welcome to the &lt;?php echo $name_of_site ?&gt; install. In order for you to install this product, you will need to
          follow the steps in the next few screens. &lt;hr /&gt;
    &lt;div class="raised" style="margin-top:5px; width:130px; height:50px; text-align:center; margin-left:75%"&gt;
      &lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
      &lt;div class="boxcontent"&gt;&lt;form action="install.php" method="post"&gt;&lt;input type="hidden" name="level" value="1" /&gt;&lt;input class="button" type="submit" name="next" value="Continue to Step 1" /&gt;&lt;/form&gt;&lt;/div&gt;
      &lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;
    &lt;/div&gt;
    &lt;/div&gt;&lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;&lt;/div&gt;
&lt;?
}

if ($level == "1")
{
?&gt;
    &lt;h3 style="margin-left:auto; margin-right:auto; width:75%; text-align:center"&gt;Step #1, MySql Connection Info&lt;/h3&gt;

     &lt;div class="raised" style="width:75%; text-align:center; margin-right:auto; margin-left:auto"&gt;&lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
    &lt;div class="boxcontent" style="padding:3px"&gt;
    &lt;?
                if ($Connection)
                {
                                echo $db;
                }

?&gt;
    &lt;form method="post" action="install.php" onsubmit="return valid_dbf(this)"&gt;

    &lt;p align="center"&gt;This information is generally given to you by your host. It is important to have this for the script to work.&lt;/p&gt;
   &lt;div style="margin:auto; text-align:center; width:70%"&gt;
   &lt;p align="left"&gt;Hostname  : &lt;input errortext="You have must enter a 'host'" type="text" name="hostname" size="20" value="localhost" /&gt;(often localhost)&lt;/p&gt;
   &lt;p align="left"&gt;DB Username : &lt;input errortext="You must enter a 'Username'" type="text" name="db_username" size="20" /&gt;&lt;/p&gt;
   &lt;p align="left"&gt;DB Password : &lt;input errortext="You have must enter a 'Password'" type="text" name="db_password" size="20" /&gt;&lt;/p&gt;
   &lt;p align="left"&gt;Database Name: &lt;input errortext="You have must enter a 'Database Name'" type="text" name="db_name" size="20" /&gt;&lt;/p&gt;
   &lt;/div&gt;
    &lt;div class="raised" style="width:130px; height:50px; text-align:center; margin-left:75%"&gt;
      &lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
      &lt;div class="boxcontent"&gt;

     &lt;input type="hidden" name="level" value="2" /&gt;&lt;input class="button" type="submit" name="next" value="Continue to Step 2" /&gt;&lt;/form&gt;&lt;/div&gt;
      &lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;
    &lt;/div&gt;
    &lt;/div&gt;&lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;&lt;/div&gt;
   &lt;?


}
if ($level == "2")
{
                if (file_exists(FULL_PATH . "/admincp/" . TABLE_PREFIX . "db.php"))
                {
                                unlink(FULL_PATH . "/admincp/" . TABLE_PREFIX . "db.php");
                }

                $fd = fopen(FULL_PATH . "/admincp/" . TABLE_PREFIX . "db.php", "w+") or die("&lt;div class=\"error\"&gt;Unable to create " . TABLE_PREFIX . "db.php in admincp. Please chmod this folder to 777 and press refresh on this page.&lt;/div&gt;");
                $str_gen = "&lt;?php\n\n
    // " . date("M d, Y G:i:s") . " \n\ndefine(\"HOSTNAME\", \"{$_POST['hostname']}\");
define(\"USER\", \"{$_POST['db_username']}\");
define(\"PASS\", \"{$_POST['db_password']}\");
define(\"DBNAME\", \"{$_POST['db_name']}\");\r\n?&gt;";
                $len_gen = strlen($str_gen);
                fwrite($fd, $str_gen, $len_gen);

                fclose($fd);
?&gt;
    &lt;h3 style="margin-left:auto; margin-right:auto; width:75%; text-align:center"&gt;Step #2, Connection Info Saved&lt;/h3&gt;

     &lt;div class="raised" style="width:75%; text-align:center; margin-right:auto; margin-left:auto"&gt;&lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
    &lt;div class="boxcontent" style="padding:3px"&gt;
    &lt;div class="error"&gt;&lt;?php echo TABLE_PREFIX ?&gt;db.php has been written to admincp succesfully.&lt;/div&gt;
    &lt;p align="center"&gt;The next step will create the mysql tables for you so the script can function properly.&lt;/p&gt;
    &lt;div class="raised" style="width:130px; height:50px; text-align:center; margin-left:75%"&gt;
      &lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
      &lt;div class="boxcontent"&gt;
       &lt;form method="post" action="install.php"&gt;
     &lt;input type="hidden" name="level" value="3" /&gt;&lt;input class="button" type="submit" name="next" value="Continue to Step 3" /&gt;&lt;/form&gt;&lt;/div&gt;
      &lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;
    &lt;/div&gt;
    &lt;/div&gt;&lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;&lt;/div&gt;
    &lt;?

}

if ($level == "3")
{
                if ($Connection)
                {

                                include (FULL_PATH . "/admincp/sql.php");
                                $DBc = new DBM;
                                $DBc-&gt;connect();
                                foreach ($CarDealer_Query['Create'] AS $query)
                                {
                                                $DBc-&gt;query($query);
                                }

                                foreach ($CarDealer_Query['Insert'] AS $query)
                                {
                                                $DBc-&gt;query($query);
                                }
                                if (!$DBc-&gt;errdesc)
                                {
                                                $GetResult = "&lt;div class=\"error\"&gt;Tables have been created successfully.&lt;/div&gt;";
                                                $GetResult .= "&lt;p align=\"center\"&gt;Next step will install the scripts templates. Please continue to the next step. &lt;br /&gt;&lt;br /&gt;";
                                                $submitbtn = "&lt;input class=\"button\" type=\"submit\" name=\"next\" value=\"Continue to Step 4\" /&gt;\n";
                                                $go = "4";
                                }
                                else
                                {
                                                $GetResult = "&lt;div class=\"error\"&gt;Table creation failed. Error below: &lt;br /&gt;&lt;br /&gt;" . $DBc-&gt;errdesc . "&lt;/div&gt;";
                                                $submitbtn = "&lt;input class=\"button\" type=\"submit\" name=\"next\" value=\"Redo Step 3\" /&gt;\n";
                                                $go = "3";
                                }
                }
                else
                {
                                $GetResult = "&lt;div class=\"error\"&gt;" . TABLE_PREFIX . "db.php is not found. No Connection to mysql can be established. Please go back to setp 1 to create this file.&lt;/div&gt;";
                                $submitbtn = "&lt;input class=\"button\" type=\"submit\" name=\"next\" value=\"Back to Step 1\" /&gt;\n";
                                $go = "1";
                }
?&gt;
    &lt;h3 style="margin-left:auto; margin-right:auto; width:75%; text-align:center"&gt;Step #3, Mysql Table Creation&lt;/h3&gt;

     &lt;div class="raised" style="width:75%; text-align:center; margin-right:auto; margin-left:auto"&gt;&lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
    &lt;div class="boxcontent" style="padding:3px"&gt;
    &lt;form method="post" action="install.php"&gt;
    &lt;?php echo $GetResult ?&gt;

    &lt;div class="raised" style="width:130px; height:50px; text-align:center; margin-left:75%"&gt;
      &lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
      &lt;div class="boxcontent"&gt;

     &lt;input type="hidden" name="level" value="&lt;?php echo $go ?&gt;" /&gt;&lt;?php echo $submitbtn ?&gt;&lt;/form&gt;&lt;/div&gt;
      &lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;
    &lt;/div&gt;
    &lt;/div&gt;&lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;&lt;/div&gt;
    &lt;?
                // End of level 3...
}

if ($level == "4")
{

                $Install = &amp;new INSTALL();
                $Install-&gt;INSTALLS();
                if ($Install-&gt;InstallError)
                {
                                $GetResult = "&lt;div class=\"error\"&gt;Style Import Failed. Error below: &lt;br /&gt;&lt;br /&gt;$Install-&gt;InstallError&lt;/div&gt;";
                                $submitbtn = "&lt;input type=\"hidden\" name=\"level\" value=\"4\" /&gt;&lt;input class=\"button\" type=\"submit\" name=\"next\" value=\"Redo to Step 4\" /&gt;&lt;/form&gt;&lt;/div&gt;\n";
                }
                else
                {
                                $GetResult = "&lt;div class=\"error\"&gt;$Install-&gt;msg&lt;/div&gt;";
                                $GetResult .= "&lt;a href='admincp/index.php'&gt;Login to Your Admin&lt;/a&gt;&lt;/p&gt;
              &lt;p align=\"center\"&gt;Thank you for the Installing The $name_of_site Script. It is required to Delete this install script once done.&lt;/p&gt;\n";

                                $submitbtn = "&lt;div class=\"boxcontent\"&gt;Finished&lt;/div&gt;&lt;/form&gt;\n";

                }

?&gt;
    &lt;h3 style="margin-left:auto; margin-right:auto; width:75%; text-align:center"&gt;Step #4, Master Style Insertion&lt;/h3&gt;

     &lt;div class="raised" style="width:75%; text-align:center; margin-right:auto; margin-left:auto"&gt;&lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
    &lt;div class="boxcontent" style="padding:3px"&gt;
    &lt;?php echo $GetResult ?&gt;
    &lt;form method="post" action="install.php"&gt;
    &lt;div class="raised" style="width:130px; height:50px; text-align:center; margin-left:75%"&gt;
      &lt;b class="b1"&gt;&lt;/b&gt;&lt;b class="b2"&gt;&lt;/b&gt;&lt;b class="b3"&gt;&lt;/b&gt;&lt;b class="b4"&gt;&lt;/b&gt;
      &lt;?php echo $submitbtn ?&gt;
      &lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;
    &lt;/div&gt;
    &lt;/div&gt;&lt;b class="b4b"&gt;&lt;/b&gt;&lt;b class="b3b"&gt;&lt;/b&gt;&lt;b class="b2b"&gt;&lt;/b&gt;&lt;b class="b1b"&gt;&lt;/b&gt;&lt;/div&gt;
    &lt;?

}

?&gt;
&lt;div class="copyright"&gt;&lt;div style="display: inline;"&gt;&lt;?php echo $name_of_site ?&gt; &lt;?php echo VERSION ?&gt;&lt;/div&gt;&lt;div style="text-align:right; display: inline; width:200px"&gt;/div&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
