Sorry for this but here is another one. Everything works fine but I want the message to display in the html content. I have two files header.html and footer.html both of which are stored in an includes file and then at the top I use the include function include(includes/header.html); followed by the code for processing registration form and then include(includes/footer.html);
but when I run the file this error appears:
Parse error: syntax error, unexpected T_STRING in /Library/WebServer/Documents/myQmProj/includes/header.html on line 1
I am almost certain this has to do with the header.html file. I will post the files again.
Once again any help please
thanks
<table id=“outerTable”>
<tr><td id=“logo”>
<div>
<img src=“./images/logo.png” width=“150” height=“55” alt=“company_logo” />
</div>
</td></tr>
<tr><td id =“nav”>
<div>
<a href=“home.html”>Home</a> |
<a href=“designers.html”>Participate</a> |
<a href=“aboutUs.html”>About ADesigns</a> |
<a href=“contact.html”>Contact Us</a>
</div>
</td></tr>
<tr><td id=“banner”> <! – page banner image –>
<img src=“images/home.jpg” width=“770” height=“” alt=“welcome to ADesigns”>
</td></tr>
<tr><td>
<table id=“contentTable”>
<tr>
<td id=“topLeft”>
<div id=“welcomeBox”>
<h3>Welcome!!</h3>
<p>This is a final year project of mine that enables young aspiring designers of
any cateegory: cloths, bags, mens wear, womens wear and a host of other types.
You are free to look aroud and comment on designs but should you need more information, you have to register but
not to worry. It is free!!</p>
<p><a href=“enter.html”>Enter/Browse</a></p>
</div> <! – mainContent –>
</td>
<td id=“topRight”>
<div id=“loginRegBox”>
<h3>Join Us</h3>
<p>If you are thinking of showing your designs or connecting with like minded designers,
this is where you should be. Our site hosts a range of youngy asipring designers seeking
to show thier work wide audience. So please what are you waiting for join us now</p>
<p><a href=“login.html”>Login</a> | <a href=“register.html”>Register</a></p>
</div> <! -- mainContentRight -->
</tr>
<tr><br /></tr><tr><br /></tr>
<tr>
<td id="bottomLeft">
<div id="newDesigners">
<br />
<h3>New Designers</h3>
<p>This will show designers that are just registered into the DB.</p>
<ul>
<li><a href="">Designer A</a></li>
<li><a href="">Designer B</a></li>
<li><a href="">Designer C</a></li>
<li><a href="">Designer D</a></li>
<li><a href="">Designer E</a></li>
<li><a href="">Designer F</a></li>
</ul>
</div> <! -- mainContentBottom -->
</td>
<td id="bottomRight">
<div id="weeksDesigners">
<br />
<h3>Designers of the Week</h3>
<p>This should show a list of all designers for the week. Preferably, those that
have registered for that week.</p>
</div> <! -- mainContentBottomRight -->
</tr>
</table>
</td></tr>
$page_title = 'Welcome to ADesigns: Registration';
include ('includes/header.html');
// Check if the form has been submitted:
if (isset($_POST['submitted']))
{
$errors = array(); // Initialize an error array.
// Check for a first name:
if (empty($_POST['fname']))
{
$errors[] = 'You forgot to enter your first name.';
}
else
{
$fn = trim($_POST['fname']);
}
// Check for a last name:
if (empty($_POST['lname']))
{
$errors[] = 'You forgot to enter your last name.';
}
else
{
$ln = trim($_POST['lname']);
}
// Check for an email address:
if (empty($_POST['email']))
{
$errors[] = 'You forgot to enter your email address.';
}
else
{
$e = trim($_POST['email']);
}
// Check for a category:
$categoryValues = array('Men', 'Women', 'Kids', 'Unisex', 'Accessories', 'Shoes');
$category = ''; //start empty
//do the check here:
if(isset($_REQUEST['category']))
{
if (in_array($_POST['category'], $categoryValues)) {
$category = trim($_POST['category'] );
}
else{
$errors[] = "You forgot to select a category.";
}
}
else
{
$errors[] = "You forgot to select a category.";
}
// Check for membership type:
if (isset($_POST['membership']))
{
$membership = $_POST['membership'];
if ($membership = 'designer')
{
$membership = trim($_POST['membership']);
}
else if ($membership = 'visitor')
{
$membership = trim($_POST['membership']);
}
}
else
{
$errors[] = "You forgot to select a membership.";
}
// Check for a loaction:
if (empty($_POST['location']))
{
$errors[] = 'You forgot to enter your location.';
}
else
{
$l = trim($_POST['location']);
}
// Check for an username:
if (empty($_POST['username']))
{
$errors[] = 'You forgot to enter your username.';
}
else
{
$u = trim($_POST['username']);
}
// Check for a password and match against the confirmed password:
if (!empty($_POST['pass1']))
{
if ($_POST['pass1'] != $_POST['pass2'])
{
$errors[] = 'Your password did not match the confirmed password.';
}
else
{
$p = trim($_POST['pass1']);
}
}
else
{
$errors[] = 'You forgot to enter your password.';
}
if (empty($errors))
{
// If everything's OK.
// Register the user in the database...
require_once ('mysql_connect.php'); // Connect to the db.
// Make the query:
// $q - stands for $query
// $r - stands for $result
$q = "INSERT INTO user (fname, lname, email, category, membership, location, username, password, reg_date ) VALUES ('$fn', '$ln', '$e', '$category', '$membership', '$l', '$u', SHA1('$p'), NOW() )";
$r = @mysql_query ($q); // Run the query.
if ($r)
{
// If it ran OK.
// Print a message:
echo '<h1>Thank you!</h1>
<p>You are now registered. Please <a href="login.html">login</a></p>';
}
else
{
// If it did not run OK.
// Public message:
echo '<h1>System Error</h1>
<p class="error">You could not be registered due to a system error. We apologize for any inconvenience.</p>';
// Debugging message:
echo '<p>' . mysql_error($dbc) . '<br /><br />Query: ' . $q . '</p>';
} // End of if ($r) IF.
mysql_close($dbc); // Close the database connection.
// Include the footer and quit the script:
include ('includes/footer.html');
exit();
}
else
{
// Report the errors.
echo '<h1>Error!</h1>
<p class="error">The following error(s) occurred:<br />';
foreach ($errors as $msg)
{
// Print each error.
echo " - $msg<br />\
";
}
echo '</p><p>Please try again.</p><p><br /></p>';
} // End of if (empty($errors)) IF.
} // End of the main Submit conditional.