I am receiving an unexpected T_STRING, expecting ‘,’ or ‘;’ on line 164 but I dont have that many lines in my code. I cant figure out where it is coming from. Here is my code:
<?php
// This is the registration page for the site.
// This file both displays and processes the registration form.
// Require the configuration before any PHP code as the configuration controls error reporting:
require (‘/includes/config.inc.php’);
// The config file also starts the session.
// Include the header file:
include (‘/includes/header.html’);
// Require the database connection:
require (MYSQL);
// For storing registration errors:
$reg_errors = array();
// Check for a form submission
if ($_SERVER[‘REQUEST_METHOD’] == ‘POST’) {
// Check for a first name:
if (preg_match (‘/^[A-Z ‘.-]{2,20}$/i’, $
$fn = mysqli_real_escape_string ($dbc, $_POST[‘first_name’]);
} else {
$reg_errors[‘first_name’] = ‘Please enter your first name!’;
}
// Check for a last name:
if (preg_match (‘/^[A-Z ‘.-]{2,40}$/i’, $
$ln = mysqli_real_escape_string ($dbc, $_POST[‘last_name’]);
} else {
$reg_errors[‘last_name’] = ‘Please enter your last name!’;
}
// Check for an email address:
if (filter_var($
$e = mysqli_real_escape_string ($dbc, $_POST[’email’]);
} else {
$reg_errors[’email’] = ‘Please enter a valid email address!’;
}
// Make sure the email address is available:
$q = “SELECT email FROM users WHERE email=’$e'”;
$r = mysqli_query ($dbc, $q);
// Get the number of rows returned:
$rows = mysqli_num_rows($r);
if ($rows == 0) { // No problems!
// New query, updated for PayPal integration:
$q = “INSERT INTO users (email, first_name, last_name) VALUES (‘$e’, ‘$fn’, ‘$ln’)”;
$r = mysqli_query ($dbc, $q);
if (mysqli_affected_rows($dbc) == 1) { // If it ran OK.
// Get the user ID:
// Store the new user ID in the session:
$uid = mysqli_insert_id($dbc);
$
// Display a thanks message:
echo “<h3>Thanks!</h3><p>Thank you for registering! To complete the process,
please now click the button below so that you may pay for your site access via
PayPal. The cost is $10 (US) per year.</p>”
// PayPal link
echo ‘<form action=”
<input type=”hidden” name=”cmd” value=”_s-xclick”>
<input type=”hidden” name=”custom” value=”‘ . $uid . ‘”>
<input type=”hidden” name=”email” value=”‘ . $e . ‘”>
<input type=”hidden” name=”hosted_button_id” value=”8YW8FZDELF296″>
<input type=”image” src=”
<img alt=”” border=”0″ src=”
</form>
// Send a separate email?
$body = “Thank you for registering at <whatever site>. Blah. Blah. Blah.nn”;
mail($[email][email protected]
// Finish the page:
// Include the HTML footer.
include (‘/includes/footer.html’);
// Stop the page.
exit();
} else { // If it did not run OK.
trigger_error(‘You could not be registered due to a system error.
We apologize for any inconvenience.’);
if ($rows == 1) { // Both are taken.
$reg_errors[’email’] = ‘This email address has already been registered.
}}
// Get row:
$row = mysqli_fetch_array($r, MYSQLI_NUM);
if( ($row[0] == $_POST[’email’]))
{ // Both match.
$reg_errors[’email’] = ‘This email address has already been registered.
} elseif ($row[0] == $
$reg_errors[’email’] = ‘This email address has already been registered.
} // End of $rows == 2 ELSE.
} // End of $rows == 0 IF.
} // End of empty($reg_errors) IF.
{
// End of the main form submission conditional.
// Need the form functions script, which defines create_form_input():
require (‘/home/sportd5/includes/form_function.inc.php’);?>
<h3>Register</h3>
<p>Access to the site’s content is available to registered users at
a cost of $10.00 (US) per year. Use the form below to begin the registration process.
<strong>Note: All fields are required.</strong> After completing this form, you’ll be
presented with the opportunity to securely pay for your yearly subscription via
<a href=”http://www.paypal.com”>PayPal</a>.</p>
<form action=”register.php” method=”post”
accept-charset=”utf-8″ style=”padding-left:100px”>
<p><label for=”first_name”><strong>First Name</strong></label><br />
<?php create_form_input(‘first_name’, ‘text’, $reg_errors); ?>
</p>
<p><label for=”last_name”><strong>Last Name</strong></label><br />
<?php create_form_input(‘last_name’, ‘text’, $reg_errors); ?>
</p>
<p><label for=”email”><strong>Email Address</strong></label><br />
<?php create_form_input(’email’, ‘text’, $reg_errors); ?>
</p>
<input type=”submit” name=”submit_button” value=”Next →” id=”submit_button” class=”formbutton” />
</form>
<?php
// Include the HTML footer:
include (‘/includes/footer.html’);?>
Any advise or help will be appreciated.