0

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>";
	}
}
?>

Edited by asisani123: n/a

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by pzuurveen
0

why is:

do($_POST['register']);

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

<?php

  do (something) 
  {

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

As an example!

0

What should be wrote there instand of something at:

do (something)

Edited by asisani123: n/a

0

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

0

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
} 
?>

Edited by pzuurveen: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.