<% function valid_data($username, $password1, $password2, $emailaddr) { if (!$pp = popen("grep '$username:' /www/fantasy3d/.uload_pass", "r")) { %>


Fatal Program Error:
Sorry! Something's is wrong with the registration process.

<% exit(0); } $buf = rtrim(fgets($pp, 100), "\r\n"); pclose($pp); if ($buf != "") { %>


Duplicate Account:
Sorry, but a user is already registered with that username.

Please click here to try again

Click here if you have forgotten your password

<% exit(0); } if ($password1 != $password2) { %>


Password Entry Error:
Sorry: but these two passwords don't match!

Please click here to try again

<% exit(0); } if (!preg_match('/[^@]+\@[^@]+\.[^@][^@]+/', $emailaddr)) { %>


Email Address Error:
Please check your email address. It needs to be valid in order for me to send you a validation message. You will use that message to authenticate.

Please click here to try again

<% exit(0); } return 1; } $submit = $_POST['submit']; $username = $_POST['username']; $password1 = $_POST['password1']; $password2 = $_POST['password2']; $emailaddr = $_POST['emailaddr']; if (! $username || ! $password1 || ! $password2 || ! $emailaddr) { %> Fantasy3D.com Registration Page

Fantasy3D User Registration Form

Please supply us with the following information. All fields are required. We send you a link to complete registration, so you must supply a valid email address. Sorry for the hassles. We promise not to spam you. We probably won't ever send you any emails. If we do it will be rare and we promise it won't be spam.

Username
Enter Password
Repeat Password
Valid Email Address


<% if ($submit) { %> All fields are required. A valid email address is necessary to register. <% } %>

If you are already registered, click here to enter the Poser Python File Repository
<% } else { %> Fantasy3D.com Registration Results <% # clean up password1 if (valid_data($username, $password1, $password2, $emailaddr)) { $validation_code = rand(1, 100000000); $link = "http://www.fantasy3d.com/pfiles/uload_validate.php?id=". $validation_code; $myaddr = "pythonfiles@fantasy3d.com"; $message = implode('', file("template.dat")); $message = preg_replace("/#USERNAME#/", $username, $message); $message = preg_replace("/#LINK#/", $link, $message); mail( $emailaddr, "Welcome to Fantasy3D", $message, "From: $myaddr", "-f$myaddr" ); $password1 = preg_replace('/[^-:<>?@\w!#\$%&()*+,.\/]/', '', $password1); if ($password1 != $password2) { %>


Password Entry Error:
Illegal characters were found in the password - please choose a different password.
Thank You.
<% exit(0); } $password = `./uload_crypt.pl $password1 2>&1`; if (!$fp = fopen("/www/fantasy3d/.uload_validate", "a+")) { %>


Fatal Program Error:
Sorry, but I can't save data to the validation file!!!

<% exit(0); } fwrite($fp, "$username:$password:$emailaddr:$validation_code\n"); fclose($fp); %>


Registration Process "Step One" Complete...

An email message has been sent to <%=$emailaddr%>

Please check your email for the message.

Click on the link in your email message in order to activate your Fantasy3D.com account. See you soon!
<% } } %>