使用 OOP 概念我创建了一个登录页面。我收到此错误: Parse error: syntax error, unexpected T_PUBLIC in C:\xampp\htdocs\oops\Register-form\functions.php on line 12。
代码
<?php
include("config.php");
class User
{
//Db Connect
public function __construct()
{
$db=new db_class();
}
}
// Registration Process
public function register_user($name,$username,$password,$email)
{
$password=md5($password);
$sql=mysql_query("select * from login where username='$username' or emailid='$email'");
if(mysql_num_rows($sql)==0)
{
$result=mysql_query("insert into login(username,password,name,emailid) values('$username','$password','$name','$email')");
return result;
}
else
{
return false;
}
}
如何解决这个问题?