Ok This is really starting to annoy me! What the hell is wrong with this code!?
I keep getting an unexpected ‘}’ error message whenever i try to put the if statements in curly braces so that I can put else statements in aswell.
And if I take the unexpected one away, of course I get a unexpexted $end message at the end of my code. Granted, the code runs fine without the curly brackets but theres no way of telling the user what was wrong with their form. GAHHHHH! It’s killing me!
Any help is GREATLY appreciated! Thanks in advance!! ;D
[php]<?php
error_reporting(0);
$submit = $_POST[‘submit’];
//Note to self: md5() and strip_tags() are for encryption and safety
$username = strip_tags($_POST[‘username’]);
$password = strip_tags($_POST[‘password’]);
$repeatpassword = strip_tags($_POST[‘repeatpassword’]);
$fullname = strip_tags($_POST[‘fullname’]);
$date = date(“Y-m-d”);
if ($submit){
//check for existence
if($username&&$password&&$fullname&&$repeatpassword) {
//check password length
if(strlen($password)>=6){
//check match
if($password==$repeatpassword){
//encrypt password
$password = md5($password);
$repeatpassword = md5($repeatpassword);
//open database
$connect = mysql_connect("localhost", "root", "");
mysql_select_db("phplogin");
$queryreg = mysql_query("INSERT INTO users VALUES ('','$username','$password','$date','$fullname')")
}
}
}
}
[/php]