Parse error: syntax error, unexpected T_IF in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\test\fuction\register.php on line 3
I get this error at my register page

<?php
include('conn.php') 
do($_POST['register']);
<form action="register.php" method="post"
{
	$username=$_POST['username'];
	$password=$_POST['password'];
	$password2=$_POST['password2'];
	$date_now=date('Y-m-d');
	if($password==$password2 ){
		$query = "SELECT * FROM Member Where ID='$UID'";
		$result_ = mssql_query($query);
		$numRows = mssql_num_rows($result_); 
		if($numRows==0){
			$sql="dbo.up_CreateMemberAccount '0','$ID','$password','1','$date_now'";
			$result = mssql_query($sql);
			if($result)
			  echo"<script type='text/javascript'> alert(' Registration Successful. ');</script>";
			else
				echo"<script type='text/javascript'> alert(' Username is taken ');</script>";
		}else{
				echo"<script type='text/javascript'> alert(' Username already exists ');</script>";
		}
	}else{
		echo"<script type='text/javascript'> alert(' Passwords does not match  ');</script>";
	}
}
?>

why is:

do($_POST['register']);

"do" usually associates with a do-while loop:

<?php

  do (something) 
  {

  }while($_POST['register'] = '');
?>

As an example!

What should be wrote there instand of something at:

do (something)

is 'register' a variable name?
if yes then u can also do

register-$_POST['register'];

but looking a ur code i think its the name of form if i m not wrong

I gess that 'register' is the name of your submit button, if so:

if (isset($_POST['register']))
{
	$username=$_POST['username'];
	$password=$_POST['password'];
	$password2=$_POST['password2'];
....
}
else
{
?>
<form action="register.php" method="post">
  rest of your form here
<input type="submit" name="register" value="register" />
</form>
<?php
} 
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.