You haven't closed the IF statement before you opened the else... You need a "}" after the </font>";
if ($_POST['email'] == '')
{
echo "<font color=#ff0000>Please specify your last name.</font>";
}
else { .....
I did do a quick count on the register.php and found 9 open brackets { and 7 close brackets }
Looking at your code, I noticed a couple things that could make trouble-shooting easier...
With so many if statments, you want to be sure that you indent correctly. I did a quick re-do on the indents and found the other missing bracket. Basically you want the close bracked IF to line up directly below the IF statment. Same for Else statment. The code inside the IF or ELSE is indented....
Here's how I would do it...
<?
session_start();
echo "<font size=4>Signup</font><br><br>";
include("config.php");
if ($_POST['first_name'] == '') {
echo "<font color=#ff0000>Please specify your first name.</font>";
}
else {
if ($_POST['last_name'] == '') {
echo "<font color=#ff0000>Please specify your last name.</font>";
}
if ($_POST['email'] == '') {
echo "<font color=#ff0000>Please specify your last name.</font>";
}
else {
if ($_POST['username'] == '') {
echo "<font color=#ff0000>Please specify a username.</font>";
}
else {
if($_POST['password']=='') {
echo "<font color=$ff0000>Please specify a password.</font>";
}
else {
$pw = md5(password);
mysql_query("INSERT INTO members (first_name,last_name,email,username,password) VALUES ('$_POST[first_name]','$_POST[last_name]','$_POST[email]','$_POST[username]','$pw')")or die(mysql_error());
mail($_POST['email'], "You have registered", "Hello ".$username." You have registered on http://domain.net Your username is ".$username." and your password is ".$password."","From:
$emailadres\r\n" ."Reply-To: youremail@host.com\r\n");
echo "You've been registered!";
}
}
}
}
?>
Also, I find that it's easier to split functions up -- like you do your insert and mail each in just one statment.
If you do something like:
$q="insert into...";
$r=mysql_query($r);
or with mail:
$to=$_POST['email'];
$body="you have been registered... ";
$subject="registration confirmation";
mail ($to, $subject, $body);
It's then eaiser if you have problems - you can echo the $q or $to to see whats going on.
One last thing...
When posting your question, copy down the exact error that you get in the browser.
As a quick example, I just broke the page I'm working on...
When I took out a } I got this error:
Parse error: syntax error, unexpected $end in /home/danielle/public_html/gallery/shared/siteprefs.php on line 47
And when I put an extra } in, I got this:
Parse error: syntax error, unexpected '}' in /home/danielle/public_html/gallery/shared/siteprefs.php on line 45
Hope this helps....