Hi,
I'm getting the following parse error on my reg script. I've checked all the syntax a number of times without resolving. I'm hoping its something simple.
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\testingsite\adduser.php on line 38
Please see the code below, its not that long: :-)
<?php
session_start();
$mysql = mysql_connect("localhost","lala","lala") or die ("Could not connect to mysql");
mysql_select_db("mybusiness",$mysql) or die ("No database");
$username = strtolower(trim($_POST['username']));
$password = $_POST['password'];
$password2 = $_POST['password2'];
$checkusername = mysql_query("SELECT `username` FROM `clients` " . "WHERE `username` = '" . $_POST['username'] . "'",$mysql);
if(mysql_num_rows($checkusername) == "1")
{
echo "Username taken, please try again<p>";
include "signup.php";
exit;
}
if(strlen($_POST['username'] > 32))
{
echo "The username is too long<p>";
include "signup.php";
exit;
if($_POST['password'] != $_POST['password2'])
{
echo "Passwords do not match, please try again<p>";
include "signup.php";
exit;
}
$password = md5($_POST['password']);
mysql_query("INSERT INTO `clients` (`username`,`password`) " . "VALUES ('" . $username . "','" . $password . "')",$mysql);
$_SESSION['user'] = $username;
header("Location: index.php");
?>
Many thanks