session_start(); $module = "members"; $sagmenu = "1"; $title = "Treading Area - Member Area | Register - Step 1"; include "../header.php"; if ($_SESSION['resim_yazisi'] != "") { $resim_yazisi = $_SESSION['resim_yazisi']; }else { $resim_yazisi = RAND(11111, 99999); session_register("resim_yazisi"); } if ($_REQUEST['step1'] == "on") { $RegisterError = "Off"; // email control $UserName = strtolower($_REQUEST['username']); if ((!eregi("^([a-z0-9_])", $UserName)) OR eregi("Ý", $UserName) OR eregi("ý", $UserName) OR eregi("þ", $UserName) OR eregi("Þ", $UserName) OR eregi("ð", $UserName) OR eregi("ü", $UserName) OR eregi("ö", $UserName) OR eregi("ç", $UserName) OR (strlen($UserName) < 2) ) { $username_hata = "Username not allowed.."; $username_renk = "bgcolor=FFDDDD"; $username_text_renk = " style=\"background-color: #FFFFE8\""; $username_value = " value=\"".$UserName."\""; $RegisterError = "On"; } else { $username_value = " value=\"".$UserName."\""; } if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $_REQUEST['email'])) { $email_hata = "Invalid email address."; $email_renk = "bgcolor=FFDDDD"; $email_text_renk = " style=\"background-color: #FFFFE8\""; $email_value = " value=\"".$_REQUEST['email']."\""; $RegisterError = "On"; } else { $email_value = " value=\"".$_REQUEST['email']."\""; } $control_sqll = "select id, username, email from members where username = '" . $UserName . "' OR email = '".$_REQUEST['email']."' "; $user_control_sql = mysql_query($control_sqll); if (mysql_num_rows($user_control_sql) > 0) { $control_veri = mysql_fetch_array($user_control_sql); $control_hata = ""; if (($control_veri['username'] == $_REQUEST['username']) OR (strtolower($control_veri['username']) == $UserName)) { $control_hata .= "This e-mail address registered.Please enter another e-mail address.."; $userde_hatali = ""; $username_renk = "bgcolor=FFDDDD"; $username_text_renk = " style=\"background-color: #FFFFE8\""; } if ($control_veri['email'] == $_REQUEST['email']) { $control_hata .= $userde_hatali."This e-mail address registered.Please enter another e-mail address.."; $email_renk = "bgcolor=FFDDDD"; $email_text_renk = " style=\"background-color: #FFFFE8\""; } $control_renk = "bgcolor=FFDDDD"; $control_text_renk = " style=\"background-color: #FFFFE8\""; $RegisterError = "On"; } if (strlen($_REQUEST['password']) < 4) { $pass_hata = "Your password not allowed. Please enter between 4 and 32 characters."; $pass_renk = "bgcolor=FFDDDD"; $pass_text_renk = " style=\"background-color: #FFFFE8\""; $RegisterError = "On"; } if ($_REQUEST['password'] != $_REQUEST['repassword']) { $pass2_hata = "Your password and re-password does not match.Please re-enter your password."; $pass2_renk = "bgcolor=FFDDDD"; $pass2_text_renk = " style=\"background-color: #FFFFE8\""; $RegisterError = "On"; } if ((!eregi(" ", $_REQUEST['user_name'])) OR (strlen($_REQUEST['user_name']) < 5)) { $name_hata = "Wrong last and first name."; $name_renk = "bgcolor=FFDDDD"; $name_text_renk = " style=\"background-color: #FFFFE8\""; $name_value = " value=\"".$_REQUEST['user_name']."\""; $RegisterError = "On"; } else { $name_value = " value=\"".$_REQUEST['user_name']."\""; } if (strlen($_REQUEST['company']) < 5) { $comp_hata = "Please enter your correct company name.."; $comp_renk = "bgcolor=FFDDDD"; $comp_text_renk = " style=\"background-color: #FFFFE8\""; $comp_value = " value=\"".$_REQUEST['company']."\""; $RegisterError = "On"; } else { $comp_value = " value=\"".$_REQUEST['company']."\""; } if ($_REQUEST['category'] == "noselect") { $cat_hata = "Please select your business category.."; $cat_renk = "bgcolor=FFDDDD"; $cat_text_renk = " style=\"background-color: #FFFFE8\""; $cat_value = $_REQUEST['category']; $RegisterError = "On"; } else { $cat_value = $_REQUEST['category']; } if ($_REQUEST['category'] == "maincat") { $cat_hata = "Only subcategories can be selected!"; $cat_renk = "bgcolor=FFDDDD"; $cat_text_renk = " style=\"background-color: #FFFFE8\""; $cat_value = $_REQUEST['category']; $RegisterError = "On"; } else { $cat_value = $_REQUEST['category']; } if (strlen($_REQUEST['address']) < 7) { $address_hata = "Please enter your correct business address..."; $address_renk = "bgcolor=FFDDDD"; $address_text_renk = " style=\"background-color: #FFFFE8\""; $address_value = $_REQUEST['address']; $RegisterError = "On"; } else { $address_value = $_REQUEST['address']; } if ($_REQUEST['country'] == "noselect") { $country_hata = "Please select a country."; $country_renk = "bgcolor=FFDDDD"; $country_text_renk = " style=\"background-color: #FFFFE8\""; $country_value = $_REQUEST['country']; $RegisterError = "On"; } else { $country_value = $_REQUEST['country']; } if (strlen($_REQUEST['state']) < 2) { $state_hata = "Please enter your state or city."; $state_renk = "bgcolor=FFDDDD"; $state_text_renk = " style=\"background-color: #FFFFE8\""; $state_value = " value=\"".$_REQUEST['state']."\""; $RegisterError = "On"; } else { $state_value = " value=\"".$_REQUEST['state']."\""; } list($tuk, $tak, $tnk) = explode(".", $_REQUEST['tel']); $etak = $tak; $etnk = $tnk; settype($tak, "integer"); settype($tnk, "integer"); $telefon_hatasi = "no"; if ($tak != $etak) { $telefon_hatasi = "yes"; } if ($tnk != $etnk) { $telefon_hatasi = "yes"; } if (substr($tuk, 0, 1) != '+') { $telefon_hatasi = "yes"; } if (strlen($tuk) < 2) { $telefon_hatasi = "yes"; } if (gettype($tak) != "integer") { $telefon_hatasi = "yes"; } if (strlen($tnk) < 5) { $telefon_hatasi = "yes"; } if (gettype($tnk) != "integer") { $telefon_hatasi = "yes"; } if ($telefon_hatasi == "yes") { $tel_hata = "Please enter your correct phone number. Example: +90.212.3209000"; $tel_renk = "bgcolor=FFDDDD"; $tel_text_renk = " style=\"background-color: #FFFFE8\""; $tel_value = " value=\"".$_REQUEST['tel']."\""; $RegisterError = "On"; } else { $tel_value = " value=\"".$tuk.".".$tak.".".$tnk."\""; } if ($_REQUEST['fax'] != "") { // fax control begin list($fuk, $fak, $fnk) = explode(".", $_REQUEST['fax']); $efak = $fak; $efnk = $fnk; settype($fak, "integer"); settype($fnk, "integer"); $fax_hatasi = "no"; if ($fak != $efak) { $fax_hatasi = "yes"; } if ($fnk != $efnk) { $fax_hatasi = "yes"; } if (substr($fuk, 0, 1) != '+') { $fax_hatasi = "yes"; } if (strlen($fuk) < 2) { $fax_hatasi = "yes"; } if (gettype($fak) != "integer") { $fax_hatasi = "yes"; } if (strlen($fnk) < 5) { $fax_hatasi = "yes"; } if (gettype($fnk) != "integer") { $fax_hatasi = "yes"; } if ($fax_hatasi == "yes") { $fax_hata = "Please enter your correct fax number. Example: +90.212.3209000"; $fax_renk = "bgcolor=FFDDDD"; $fax_text_renk = " style=\"background-color: #FFFFE8\""; $fax_value = " value=\"".$_REQUEST['fax']."\""; $RegisterError = "On"; } else { $fax_value = " value=\"".$fuk.".".$fak.".".$fnk."\""; } } if ($_REQUEST['on_check'] != "yes") { $oc_hata = "Sorry, You can not be a member of Turkeypages.com.Please accept Membership Agreement."; $oc_renk = "bgcolor=FFDDDD"; $oc_value = "no"; $oc_text_renk = " style=\"background-color: #FFFFE8\""; $RegisterError = "On"; } else { $oc_value = "yes"; } if ($_SESSION['resim_yazisi'] != $_REQUEST['verificode']) { $verified_hata = "Please type in the word shown above.."; $verified_renk = "bgcolor=FFDDDD"; $verified_value = "no"; $verified_text_renk = " style=\"background-color: #FFFFE8\""; $RegisterError = "On"; //$resim_yazisi = RAND(11111, 99999); session_register("resim_yazisi"); } //else { $resim_yazisi = RAND(11111, 99999); session_register("resim_yazisi"); } if ($RegisterError == "Off") { $encodepass = md5($_REQUEST['password']); $ConfirmCode = RandomChars(8); $sql = "INSERT INTO members (id, category, email, username, password, name, company, www, address, country, state, zip, phone, fax, regtime, confirmcode, status) VALUES ('', '".$cat_value."', '" . $_REQUEST['email'] . "', '" . $UserName . "', '" . $encodepass . "', '" . $_REQUEST['user_name'] . "', '" . $_REQUEST['company'] . "', '" . $_REQUEST['web_url'] . "', '" . $_REQUEST['address'] . "', '" . $_REQUEST['country'] . "', '" . $_REQUEST['state'] . "', '" . $_REQUEST['postalcode'] . "', '" . $_REQUEST['tel'] . "', '" . $_REQUEST['fax'] . "', '" . time() . "', '" . $ConfirmCode . "', '0')"; $add_member = mysql_query($sql); $header = "From: Turkeypages Registration \n"; $header .= "Content-Type: text/plain; charset=iso-8859-9\n"; $header .= "X-Sender: Turkeypages Registration \n"; $header .= "X-Mailer: Turkeypages\n"; $header .= "X-Priority: 1\n"; $header .= "Return-Path: <$SERVER_ADDR>\n"; $email_title = "Your Turkeypages Registration Confirmation"; $email_message = "Dear ". $_REQUEST['user_name'] .", Welcome to the Turkeypages Treading Area! Use your Member ID and Password for all FREE services on Turkeypages. Member ID: " . $_REQUEST['email'] . " Password: " . $_REQUEST['password'] . " Upon initial Sign In, a Verification Code must be entered to validate your registration. This verification, ensures accurate delivery of all Turkeypages services and also prevents fraud. Verification Code: ".$ConfirmCode." For initial Sign In, go to: ".$myurl."members/index.php Or Verify Address: ".$myurl."members/confirmation.php?email=".$_REQUEST['email']."&ConfirmCode=".$ConfirmCode."&Confirmation=yes http://www.turkeypages.com Treading Area"; @mail($_REQUEST['email'], $email_title, $email_message, $header); Header("Location: ".$myurl."members/confirmation.php?email=".$_REQUEST['email']); } } ?> Registration Form if ($RegisterError == "On") { ?> Some fields are missing or entered wrong. This fields shown in red color.. if ($control_hata != "") { echo "" . $control_hata . ""; } ?> } ?> E-Mail * if ($email_hata != "") { ?> } ?> Username * if ($username_hata != "") { ?> } ?> Password * if ($pass_hata != "") { ?> } ?> Re-Password * if ($pass2_hata != "") { ?> } ?> Last and First Name * if ($name_hata != "") { ?> } ?> Company Name * if ($comp_hata != "") { ?> } ?> Business Category Please Select Your Business Category $SubCatQuery = mysql_query("select SubId, CatId, SubCatName from subcategories order by CatId, SubCatName"); $SubCatCount = mysql_num_rows($SubCatQuery); $SubId = Array(); $SubCatId = Array(); $SubCatName = Array(); for ($Si=0; $Si < $SubCatCount; $Si++) { $S = mysql_fetch_array($SubCatQuery); $SubId[$Si] = $S['SubId']; $SubCatName[$Si] = $S['SubCatName']; $SubCatId[$Si] = $S['CatId']; } $CategoryQuery = mysql_query("select CatId, CatName from categories group by CatName order by CatName"); $CategoryCount = mysql_num_rows($CategoryQuery); for ($Ci=0; $Ci < $CategoryCount; $Ci++) { $Cat = mysql_fetch_array($CategoryQuery); //if ($cat_value == $Cat['CatId']) { $CatSelect = " selected"; } else { $CatSelect = ""; } echo " " . $Cat['CatName'] . "\n"; for ($Sa=0; $Sa < $SubCatCount; $Sa++) { if ($SubCatId[$Sa] == $Cat['CatId']) { if ($SubId[$Sa] == $cat_value) { $SubCatSelect = " selected"; } else { $SubCatSelect = ""; } echo " > " . $SubCatName[$Sa] . "\n"; } } } ?> * if ($cat_hata != "") { ?> } ?> Web Address * Business Address * if ($address_hata != "") { ?> } ?> Country Please Select Your Country $CountryQuery = mysql_query("select CountryId, CountryName from country order by CountryName"); $CountryCount = mysql_num_rows($CountryQuery); for ($Ci=0; $Ci < $CountryCount; $Ci++) { $Country = mysql_fetch_array($CountryQuery); if ($country_value == $Country['CountryId']) { $CountrySelect = " selected"; } else { $CountrySelect = ""; } echo " " . ucwords($Country['CountryName']) . "\n"; } ?> * if ($country_hata != "") { ?> } ?> State/City * if ($state_hata != "") { ?> } ?> Zip Code Business Phone * (Sample: +90.212.3209000) if ($tel_hata != "") { ?> } ?> Fax Number * (Sample: +90.212.3209000) if ($fax_hata != "") { ?> } ?> name="on_check" value="yes"> I agree to Turkeypages.com's Use Agreement. if ($oc_hata != "") { ?> } ?> Verify Your Registration " align="absmiddle"> * Please type in the numbers shown above... if ($verified_hata != "") { ?> } ?> include "../footer.php"; ?>