This is because function is outside the class. Should be
<?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;
}
}
}
?>
1
solved OOP login page error [closed]