session_start();
include("database.php");
include("login3.php");
function usernameTaken($username){
global $conn;
if(!get_magic_quotes_gpc()){
$username = addslashes($username);
}
$q = "select username from users where username = '$username'";
$result = mysql_query($q,$conn);
return (mysql_num_rows($result) > 0);
}
function addNewUser($username, $password, $fname, $last, $firm, $lname, $website, $cname, $ctype, $country, $fax){
global $conn;
$q = "INSERT INTO users VALUES ('$username', '$password', '$fname', '$last', '$firm', '$lname', '$website', '$cname', '$ctype', '$country', '$fax')";
return mysql_query($q,$conn);
}
function displayStatus(){
$uname = $_SESSION['reguname'];
if($_SESSION['regresult']){
?>
}
else{
?>
}
unset($_SESSION['reguname']);
unset($_SESSION['registered']);
unset($_SESSION['regresult']);
}
if(isset($_SESSION['registered'])){
?>
Registration Page
displayStatus(); ?>
return;
}
if(isset($_POST['subjoin'])){
if(!$_POST['user'] || !$_POST['pass'] || !$_POST['firm'] || !$_POST['ctype'] || !$_POST['country']){
die('You didn\'t fill in a required field.');
}
$_POST['user'] = trim($_POST['user']);
if(strlen($_POST['user']) > 255){
die("Sorry, the username is longer than 255 characters, please shorten it.");
}
if(usernameTaken($_POST['user'])){
$use = $_POST['user'];
die("Sorry, the username: $use is already taken.");
}
if (isset($_POST['checkbox'])) {
mail("info@expertsatmcs.com", "Expertsatmcs Mailing List user", "A new user, with email $user has asked to go on the mailing list. Go to www.expertsatmcs.com/admin to view this users details.", "From: info@expertsatmcs.com\nX-Mailer: Expertsatmcs mailer\n");
}
$md5pass = md5($_POST['pass']);
$_SESSION['reguname'] = $_POST['user'];
$_SESSION['regresult'] = addNewUser($_POST['user'], $md5pass, $_POST['fname'], $_POST['last'], $_POST['firm'], $_POST['lname'], $_POST['website'], $_POST['cname'], $_POST['ctype'], $_POST['country'], $_POST['fax']);
$_SESSION['registered'] = true;
echo "";
return;
}
else{
?>
Medical Consultant Services, Inc.: expert witnesses, utilization review, independent medical examinations, biomechanical engineering, accident reconstruction, forensic experts, continuing legal education, cle, mcle provider
}
?>