15){$disperr='display name too long';} } if ($email!=''){ $query="SELECT * FROM filam_members WHERE email='$email'"; $num=mysql_numrows(mysql_query($query)); if ($num>0){$emailerr='email already in use';} // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. $emailerr='invalid email address'; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { $emailerr='invalid email address'; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { $emailerr='invalid email address'; } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { $emailerr='invalid email address'; } } } } if ($zipcode!=''){ $query="SELECT * FROM zip_code WHERE zip_code='$zipcode'"; $num=mysql_numrows(mysql_query($query)); if ($num==0){$ziperr='invalid zip code';} } if ($passwd2!=''){ if ($passwd2!=$passwd){$passerr2='password does not match';} } if ($char!=''){ if ($codenum==1){$code="k3p7dw";} if ($codenum==2){$code="4zqmj5";} if ($codenum==3){$code="sw28th";} if ($char!=$code){$charerr='characters do not match';} } if ($firsterr=='0' && $lasterr=='0' && $disperr=='0' && $passerr=='0' && $passerr2=='0' && $emailerr=='0' && $ziperr=='0' && $charerr=='0'){ $query="SELECT * FROM zip_code WHERE zip_code='$zipcode'"; $result=mysql_query($query); $city=mysql_result($result,0,"city"); $state=mysql_result($result,0,"state_name"); $query="INSERT INTO `filam_members` (firstname, lastname, displayname, password, email, city, state, zipcode, userid, confirmnum) VALUES ('$firstname', '$lastname', '$displayname', '$passwd', '$email', '$city', '$state', '$zipcode', '$useridnum', '$enc')"; mysql_query($query) or die('Error, insert query failed'); //define the receiver of the email $to = $email; //define the subject of the email $subject = "filamconnect.com - Confirm your account registration."; //define the headers we want passed. Note that they are separated with \r\n $headers = "From: filamconnect@filamconnect.com"; //define attachment name $attachment_file = ""; //read the attachment file contents into a string, //encode it with MIME base64, //and split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents($attachment_file))); $message = "Dear $firstname,\n\n"; $message .= "Thank you for creating an account with us. Please click the following link to complete and confirm your registration.\n"; $message .= "http://www.filamconnect.com/register.suphp?confirm=$enc\n\n"; $message .= "Sincerely,\n"; $message .= "filamconnect.com\n\n"; $message .= "NOTE: Please do not reply to this email as we are unable to respond to your reply from this address.\n"; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" $confirm='1'; // LET JED KNOW SOMEONE REGISTERED FOR AN ACCOUNT $to = 'jedalan@gmail.com'; //define the subject of the email $subject = "filamconnect.com - Account registration."; //define the headers we want passed. Note that they are separated with \r\n $headers = "From: filamconnect@filamconnect.com"; //define attachment name $attachment_file = ""; //read the attachment file contents into a string, //encode it with MIME base64, //and split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents($attachment_file))); $message = "Member # $useridnum has registered for an account.\n\n"; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" } } ?> filamconnect.com
Create your account.


"; if ($confirm=='0'){echo "
"; if ($firsterr=='0'){echo "first name";} else {echo "$firsterr";} echo "
"; if ($lasterr=='0'){echo "last name";} else {echo "$lasterr";} echo "
"; if ($disperr=='0'){echo "display name*";} else {echo "$disperr";} echo "
*NOTE: Enter a display name if you don't want your full name displayed in the People section.
"; if ($passerr=='0'){echo "password";} else {echo "$passerr";} echo "
"; if ($passerr2=='0'){echo "retype password";} else {echo "$passerr2";} echo "
"; if ($emailerr=='0'){echo "email address";} else {echo "$emailerr";} echo "
"; if ($ziperr=='0'){echo "zip code";} else {echo "$ziperr";} echo "
"; if ($charerr=='0'){echo "enter the characters you see";} else {echo "$charerr";} echo "
"; $codenum=rand(1, 3); echo ""; echo "
By clicking Submit, you are acknowledging that you have read the Terms of Service and Privacy Policy.
"; } if ($confirm=='1'){echo "
Salamat! An email has been sent to the email address you provided. Please follow its instructions to finish creating your account.";} elseif ($confirm!='0' || $confirm!=0){ echo ""; $query="SELECT * FROM filam_members WHERE confirmnum='$confirm'"; $result=mysql_query($query); $num=mysql_numrows($result); if ($num!=0){ $todaysdate = date("Y-m-d"); $query="UPDATE `filam_members` SET `confirmed` = 1, `memberdate` = '$todaysdate' WHERE confirmnum='$confirm'"; mysql_query($query) or die('Error, insert query failed'); $userid=mysql_result($result,$i,"userid"); $newdir = "members/$userid"; mkdir($newdir, 0777); chmod($newdir, 0777); $file = 'members/thumbnail_generator_original.php'; $newfile = 'members/thumbnail_generator.php'; copy($file, $newfile); $file2 = 'members/thumbnail_generator2_original.php'; $newfile2 = 'members/thumbnail_generator2.php'; copy($file2, $newfile2); $file = "members/thumbnail_generator.php"; $file2 = "members/thumbnail_generator2.php"; $newfile = "members/$userid/thumbnail_generator.php"; $newfile2 = "members/$userid/thumbnail_generator2.php"; rename($file,$newfile); rename($file2,$newfile2); chmod($newfile, 0644); chmod($newfile2, 0644); $file = "members/index.html"; $tempfile = "members/tempindex.html"; $newfile = "members/$userid/index.html"; copy($file, $tempfile); rename($tempfile,$newfile); chmod($newfile, 0644); echo "Salamat! You've just confirmed your account registration. Click here to login and complete your user profile."; // LET JED KNOW SOMEONE DELETED THEIR ACCOUNT $to = 'jedalan@gmail.com'; //define the subject of the email $subject = "filamconnect.com - Account confirmed."; //define the headers we want passed. Note that they are separated with \r\n $headers = "From: filamconnect@filamconnect.com"; //define attachment name $attachment_file = ""; //read the attachment file contents into a string, //encode it with MIME base64, //and split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents($attachment_file))); $message = "Member # $userid has confirmed his/her account.\n\n"; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" } else {echo "Sorry, this confirmation link is invalid.";} echo ""; } ?>