12 || $birth_day < 0 || $birth_day > 31 || $birth_year < 1900){ $error = "Invalid Date of Birth."; return($error); } } if(ereg("jpeg", $picture_type)) { if($picture_size > 50000){ $error = "Picture file too large."; return($error); } } else { $error = "Invalid picture file format. JPEG's only."; return($error); } if(strlen($profile) > 500) { $error = "Profile too long."; return($error); } if(strlen($interests) > 500) { $error = "Interests too long."; return($error); } if(strlen($bands) > 500) { $error = "Interests too long."; return($error); } } function submit_data($dbh, $username, $password, $name, $gender, $sexuality, $dob, $city, $state, $country, $email, $aim, $ym, $icq, $website, $profile, $interests, $bands) { if ($website == "http://") { $website = ""; } $result = mysql_query("insert into users (username, password, signup_time, status) values ('$username', '$password', sysdate(), 9)", $dbh); $sql = 'select user_num from users where username = \'' . $username . '\''; $result = mysql_query($sql, $dbh); $data = mysql_fetch_array($result); $result = mysql_query("insert into profiles values ('$data[user_num]', '$name', '$gender', '$sexuality', '$dob', '$city', '$state', '$country', '$email', '$aim', '$ym', '$icq', '$website', '$profile', '$interests', '$bands', sysdate(), 0)", $dbh); $result = mysql_query("insert into settings values ('$data[user_num]', 1, 1)", $dbh); } $f = $_POST['f']; if ($f == "signup") { extract($_POST); $picture = $_FILES['picture']['name']; $picture_name = $_FILES['picture']['tmp_name']; $picture_type = $_FILES['picture']['type']; $picture_size = $_FILES['picture']['size']; $dbh = @mysql_connect($DBHOST, $DBUSER, $DBPASSWORD); mysql_select_db($DBNAME, $dbh); $error = check_submitted_data($dbh, $username, $password, $password_conf, $name, $gender, $birth_month, $birth_day, $birth_year, $email, $picture, $picture_type, $picture_size, $profile, $interests, $bands); if($error == "") { mkdir ("images/". $username, 0755); mkdir ("images/". $username . "/videochat", 0755); // 0777 doesn't work??? chmod ("images/". $username . "/videochat", 0777); // Take that fucker!!! mkdir ("images/". $username . "/upload", 0755); // 0777 doesn't work??? chmod ("images/". $username . "/upload", 0777); // Take that fucker!!! process_image($username, $picture_name); if($birth_month && $birth_day && $birth_year){ $dob = $birth_year . "-" . $birth_month . "-" . $birth_day; } submit_data($dbh, $username, $password, $name, $gender, $sexuality, $dob, $city, $state, $country, $email, $aim, $ym, $icq, $website, $profile, $interests, $bands); $result = mysql_query("insert into login_history values ('$username', '$ip_address', sysdate())", $dbh); mysql_close($dbh); header("Location: " . prep_url("index.php", true)); exit(); } else { $profile = stripslashes($profile); $interests = stripslashes($interests); $bands = stripslashes($bands); } mysql_close($dbh); } ?>