";} if(!$lname){$msg.="*** Please provide your last name
";} if(!$email){$msg.="*** Please provide your email address
";} if($email){////check the email address if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {$msg.="*** Please provide a good email address
";} }//EOR check the email address if(!$address){$msg.="*** Please provide your mailing address
";} if(!$city){$msg.="*** Please provide the city you reside in
";} if(!$state){$msg.="*** Please provide the state you reside in
";} if(!$country){$msg.="*** Please provide the country you reside in
";} if(!$zip){$msg.="*** Please provide your postal code
";} if(!$phone){$msg.="*** Please provide your main phone number
";} if(!$edition){$msg.="*** Please provide which edition you are registering
";} if($edition==="third") {///make sure the ID is good //echo"yup';exit; if(!$f3){$msg.="*** Please provide the Nerdbook® ID code
";} if(!$s3){$msg.="*** Please provide the Nerdbook® ID code
";} /*if(!$t3){$msg.="*** Please provide the Nerdbook® ID code
";}*/ /*if($f3){if($f3<>"978" && $f3 <> "200"){$msg.="*** Please correct the Nerdbook® ID code
";}}*/ if($f3){if($f3<>"978" && $f3 <> "200" && $f3 <> "928"){$msg.="*** Please correct the Nerdbook® f3 ID code
";}} if($f3){if($s3<>"096" && $s3 <> "702" && $s3 <> "703"&& $s3 <> "010"){$msg.="*** Please correct the Nerdbook® s3 ID code
";}} /*if($f3){if($s3<>"096" && $s3 <> "702" && $s3 <> "703"){$msg.="*** Please correct the Nerdbook® ID code
";}}*/ /*if($f3){if($t3<>"0071"){$msg.="*** Please correct the Nerdbook® ID code
";}}*/ }///EORmake sure the ID is good if(!$heard){$msg.="*** Please tell us how you first heard of Nerdbook®
";} ///////////////all good data Routine if(!$msg){ ///check for dupes require("../sophia/database/connect.php"); mysql_select_db(nerdbook_com); $result = mysql(nerdbook_com, "select * from newreg where email = '$email' and edition = '$edition'"); $num_results = mysql_num_rows($result); if($num_results > 0 ){$msg.="*** This email has already been used to register a Nerdbook $edition Edition, please change the email or edition.
";} }//EOR///////////////all good data Routine if(!$msg){//////ALL GOOD - NO DUPES - LETS DO IT////////////////////////////////////// ///gen pass $str = ''; for ($i=1; $i<=8; $i++){ $set = array(rand (65,90),rand(97,122)); $str .= chr($set[rand(0,1)]); } $password=$str; $str = ''; for ($i=1; $i<=25; $i++){ $set = array(rand (65,90),rand(97,122)); $str .= chr($set[rand(0,1)]); } $actKey=$str; //echo"$actKey";exit; ///EOR gen pass //add slashes $fname=addslashes($fname); $lname=addslashes($lname); $email=addslashes($email); $address=addslashes($address); $city=addslashes($city); $state=addslashes($state); $country=addslashes($country); $zip=addslashes($zip); $phone=addslashes($phone); $edition=addslashes($edition); $heard=addslashes($heard); $schoolyear=addslashes($schoolyear); $school=addslashes($school); $yeargrad=addslashes($yeargrad); $other=addslashes($other); ////get access data if (getenv(HTTP_X_FORWARDED_FOR)){ $ip=getenv(HTTP_X_FORWARDED_FOR); } else { $ip=getenv(REMOTE_ADDR); } $rhost = @gethostbyaddr($REMOTE_ADDR); $useragent = getenv('HTTP_USER_AGENT'); ///Get date and time $rdate=date('Ymd'); $rtime=date('H:i:s'); ////input record $regCode=$f3.$s3; $sql="INSERT INTO `newreg` (`regID`, `fname`, `lname`, `email`, `address`, `city`, `state`, `country`, `zip`, `phone`, `edition`, `heard`, `schoolyear`, `school`, `practiceyears`, `yeargrad`, `other`, `ip`, `rhost`, `useragent`, `rdate`, `rtime`, `password`, `regCode`, `actKey`, `status`) VALUES ('', '$fname', '$lname', '$email', '$address', '$city', '$state', '$country', '$zip', '$phone', '$edition', '$heard', '$schoolyear', '$school', '$practiceyears', '$yeargrad', '$other', '$ip', '$rhost', '$useragent', '$rdate', '$rtime', '$password', '$regCode', '$actKey', 'Pendind')"; if(!mysql_query($sql)){echo"Failed to add record and stopped";exit;} /* $sql="INSERT INTO `newreg` (`regID`, `fname`, `lname`, `email`, `address`, `city`, `state`, `country`, `zip`, `phone`, `edition`, `heard`, `schoolyear`, `school`, `practiceyears`, `yeargrad`, `other`, `ip`, `rhost`, `useragent`, `rdate`, `rtime`, `password`, `actKey`, `status`) VALUES ('', '$fname', '$lname', '$email', '$address', '$city', '$state', '$country', '$zip', '$phone', '$edition', '$heard', '$schoolyear', '$school', '$practiceyears', '$yeargrad', '$other', '$ip', '$rhost', '$useragent', '$rdate', '$rtime', '$password', '$actKey', 'Pending')"; if(!mysql_query($sql)){echo"Failed to add record and stopped";exit;}*/ ////Send email if($edition==='third'){ $subject = "Nerdbook Registration"; $message = " Nerdbook Registration Activation Email
Nerdbook 3rd Edition Registration Activation
Hello $fname $lname,
Thank you for registering the Nerdbook 3rd Edition.
In appreciation, we have extended a FREE Nerdbook Extras area for your use.
In order to take advantage of this resource your need to activate your registration by clicking here. Once activated you will be given full access to the additional resources.

Thanks again,
Dr. Sophia Yin
Cattledog Publishing
"; $headers = "MIME-Version: 1.0\n"; $headers .="Content-type: text/html; charset=iso-8859-1\n"; $headers .= "X-Mailer: PHP4\n"; //mailer $headers .="X-Priority: 3 (Normal)\n"; //$headers .="Disposition-Notification-To: \"$em\" <$name>\n"; $headers .="From: Nerdbook Registration\n"; mail($email, $subject, $message, $headers); }///EOR Send Email for third edition header("Location: thanksreg.php?edition=$edition");exit; }//////EOR ALL GOOD - NO DUPES - LETS DO IT/////////////////////////////////////////// }////EOR do the data qualify routines ?> Registration Form
Register Your Nerdbook
Please provide the following information to register your Nerdbook®.
$msg

";} ?> indicates required information.
First Name: "id="fname" />
Last Name: "/>
Permanent Email Address: "/>
Mailing Address: "/>
City: "/>
State or Province: "/>
Country: "/>
Postal Code: "/>
Main Phone Number: "/>
Which Version of the Nerdbook® are you registering?
/> 1st Edition
/> 2nd Edition
/> 3rd Edition*
*(includes FREE access to the Nerdbook® Extras area)
If you are registering the 3rd Edition, please enter the ID Number. This number is located on the back of the cover page under the section titled: REGISTER YOUR BOOK. ID: " maxlength="3" /> - " maxlength="3" /> Cattledog
How did you first hear about Nerdbook®
/> Saw it in the bookstore.
/> Saw it in a catalogue or ad.
/> Saw others using it.
/> A friend recommended it, but I'd never seen it prior to ordering.
/> Saw it in a web page ad.
Veterinary students, fill out this portion:
Year in school when Nerdbook® was purchased: /> 1st
/> 2nd
/> 3rd
/> 4th
Name of Veterinary School: " />
Veterinarians fill out this portion:
Years of practice: " />
Year graduated from veterinary school: " />
What other similar products would you like to see from CattleDog Publishing ?
*If you are registering the 3rd Edition of Nerdbook, an email will be sent to you with access instructions to the Nerdbook® Extras area.

end_shadow(); ?>