<?php
function registr($user,$password,$stats){
if(empty($user) || empty($password)){
$errors['empty_form'] = true;
}
else{
$errors['empty_form'] = false;
}
return $errors['empty_form'];
}
function registr($user,$password,$stats){
if($fresult==0){
$sql="INSERT INTO members VALUES('','".$user."','".$password."','".$stats."')";
$result=mysql_query($sql);
mysql_close();
}
require_once("config.php");
// Connect to server and select database.
mysql_connect("$dblocation", "$dbuser", "$dbpasswd")or die("cannot connect");
mysql_select_db("$dbname")or die("cannot select DB");
$user=$_POST['cname'];
$password=$_POST['password'];
$stats="user";
$fresult=registr($user,$password,$stats);
if($fresult==0){
$e=registr($user,$password,$stats);}
else{}
?>