I'm trying to create a php-based membership program. So far, it's not going so well. I hate to dump my problems on some unwilling coder passerby, but I can't help wanting to finish what I started. Here's my
I keep getting this error:
code:
register01.php
register02.php
Thanks a whole bunch in advanced.[/code]
I keep getting this error:
| Code: |
|
Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/ddukki/public_html/register02.php on line 24 |
code:
register01.php
| Code: |
| <html>
<head> <title>Registering Test</title> </head> <body> Register here : <form action="/register02.php" method="post"> First Name<font color="0000ff">*</font>: <input type="text" name="firstname" maxlength="10"><br> <font size="1">No longer than 10 characters</font><br> Last Name<font color="0000ff">*</font>: <input type="text" name="lastname" maxlength="20"><br> <font size="1">No longer than 20 characters</font><br> Username<font color="0000ff">*</font>: <input type="text" name="username" maxlength="10"><br> <font size="1">No longer than 10 characters</font><br> Password<font color="0000ff">*</font>: <input type="password" name="password1" maxlength="7"><br> <font size="1">No longer than 7 characters</font><br> Enter Password Again<font color="0000ff">*</font>:<input type="password" name="password2" maxlength="7"><br> <font size="1">Use the exact same password as above</font><br> Email (Optional): <input type="text" name="email" maxlength="30"><br> <font size="1">No longer than 30 characters</font><br> <input type="submit" value="submit"> <font size="1">An "<font color="0000ff">*</font>" indicates a required field.</font> </body> </html> |
register02.php
| Code: |
| <html>
<head> <title>Login Test</title> </head> <body> <?php require_once 'db_connect.php'; $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $username=$_POST['username']; $password1=$_POST['password1']; $password2=$_POST['password2']; $email=$_POST['email']; if ($password1 == $password2) { echo 'Login Complete<br>Username: '.$username.'<br>Password: '.$password1.'<br>Email: '.$email;} else {echo 'The two passwords you entered did not match.'; include 'register01.html'; exit();} if((!$password1 && !$password2) || ($password1 != $password2) || (!$first_name) || (!$last_name) || (!$email_address) || (!$username) || (!$password1)) { echo 'You did not submit the following required information!<br>'; if(!$password1 && !$password2) { echo "You must enter in a <font color="0000ff">Password</font>.<br>";} if($password1 != $password2) { echo "The two passwords you entered did not match. Enter in two identical <font color="0000ff">Passwords</font>.<br>";} if(!$firstname) { echo "You must enter your <font color="0000ff">First Name</font>.<br>";} if(!$lastname) { echo "You must enter your <font color="0000ff">Last Name</font>.<br>";} if(!$email) { echo "You must enter your <font color="0000ff">Email</font>.<br>";} if(!$username) { echo "You must enter your <font color="0000ff">Username</font>.<br>";} if(!$password) { echo "You must enter in a <font color="0000ff">Password</font>.<br>";} include 'register01.html'; exit();} $sql_email_check = mysql_query("SELECT email FROM users WHERE email='$email'"); $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$username'"); $email_check = mysql_num_rows($sql_email_check); $username_check = mysql_num_rows($sql_username_check); if(($email_check > 0) || ($username_check > 0)){ echo "Please fix the following errors: <br>"; if($email_check > 0){ echo "<strong>Your email address has already been used by another member in our database. Please submit a different Email address!<br>"; unset($email_address);} if($username_check > 0){ echo "The username you have selected has already been used by another member in our database. Please choose a different Username!<br>"; unset($username);} include 'register01.html'; exit();} ?> </body> </html> |
Thanks a whole bunch in advanced.[/code]
