born4flirt Posted April 26, 2008 Share Posted April 26, 2008 Hello guyz i want to add field to moi registration process........... i had tried to butt it is not posting in mysql database......... plz help me guyz......... dis is moi unedited code <? session_cache_limiter('nocache'); session_start(); require_once("includes/templates.inc.php"); require_once("includes/site_functions.inc.php"); require_once("includes/vars.inc.php"); db_connect(_DBHOSTNAME_,_DBUSERNAME_,_DBPASSWORD_,_DBNAME_,_PCONN_); check_login_member(_GUESTLEVEL_); $name=""; $username=""; $password=""; $password2=""; $email=""; $email2=""; $gender=1; $country=1; $state=_NDISCLOSED_; $city=""; $zip=""; $addr=""; $birthday=_CHOOSE_; $birthmonth=_CHOOSE_; $birthyear=_CHOOSE_; $my_diz=""; $referrer=""; $message=""; if (isset($_SESSION['topass']) && !empty($_SESSION['topass'])) { $topass=$_SESSION['topass']; $_SESSION['topass']=""; $name=((isset($topass['name'])) ? ($topass['name']) : ("")); $username=((isset($topass['username'])) ? ($topass['username']) : ("")); $password=((isset($topass['password'])) ? ($topass['password']) : ("")); $password2=((isset($topass['password2'])) ? ($topass['password2']) : ("")); $email=((isset($topass['email'])) ? ($topass['email']) : ("")); $email2=((isset($topass['email2'])) ? ($topass['email2']) : ("")); $gender=((isset($topass['gender'])) ? ($topass['gender']) : (1)); $country=((isset($topass['country'])) ? ($topass['country']) : (1)); $state=((isset($topass['state'])) ? ($topass['state']) : (1)); $city=((isset($topass['city'])) ? ($topass['city']) : ("")); $zip=((isset($topass['zip'])) ? ($topass['zip']) : ("")); $addr=((isset($topass['addr'])) ? ($topass['addr']) : ("")); $birthday=((isset($topass['birthday'])) ? ($topass['birthday']) : (_CHOOSE_)); $birthmonth=((isset($topass['birthmonth'])) ? ($topass['birthmonth']) : (_CHOOSE_)); $birthyear=((isset($topass['birthyear'])) ? ($topass['birthyear']) : (_CHOOSE_)); $my_diz=((isset($topass['my_diz'])) ? ($topass['my_diz']) : ("")); // referrer could come in url as well as from a previous error $referrer=isset($topass['referrer']) ? $topass['referrer'] : ""; $message=((isset($topass['message'])) ? ($topass['message']) : ("")); } elseif ($_SERVER['REQUEST_METHOD']=='GET') { $referrer=isset($_GET['referrer']) ? addslashes_mq($_GET['referrer'],true) : ""; } elseif ($_SERVER['REQUEST_METHOD']=='POST') { $name=$_POST['name']; $username=$_POST['username']; $password=$_POST['password']; $password2=$_POST['password2']; $email=$_POST['email']; $email2=$_POST['email2']; $gender=$_POST['gender']; $country=$_POST['country']; $city=$_POST['city']; $zip=$_POST['zip']; $addr=$_POST['addr']; $birthday=$_POST['birthday']; $birthmonth=$_POST['birthmonth']; $birthyear=$_POST['birthyear']; $my_diz=$_POST['my_diz']; $referrer=$_POST['referrer']; } $tpl=new phemplate(_TPLPATH_.get_my_template().'/','remove_nonjs'); $field_state=""; if ($fields['users_state'][0] && isset($accepted_states[$country])) { $tpl->set_file('temp','bits/field_state.html'); $tpl->set_var('state_options',vector2options($accepted_states[$country],$state,array(_ANY_))); $field_state=$tpl->process('','temp',TPL_FINISH); } $field_city=""; if ($fields['users_city'][0]) { $tpl->set_file('temp','bits/field_city.html'); $tpl->set_var('city',htmlentities(stripslashes($city))); $field_city=$tpl->process('','temp',TPL_FINISH); } $field_zip=""; if ($fields['users_zip'][0]) { $tpl->set_file('temp','bits/field_zip.html'); $tpl->set_var('zip',htmlentities(stripslashes($zip))); $field_zip=$tpl->process('','temp',TPL_FINISH); } $field_addr=""; if ($fields['users_addr'][0]) { $tpl->set_file('temp','bits/field_addr.html'); $tpl->set_var('addr',htmlentities(stripslashes($addr))); $field_addr=$tpl->process('','temp',TPL_FINISH); } $field_mydiz=""; if ($fields['users_my_diz'][0]) { $tpl->set_file('temp','bits/field_mydiz.html'); $tpl->set_var('max_text_length',get_site_option('max_text_length')); $tpl->set_var('my_diz',htmlentities(stripslashes($my_diz))); $field_mydiz=$tpl->process('','temp',TPL_FINISH); } $tpl->set_file('leftcontent','register_left.html'); $tpl->set_var('tplurl',_TPLURL_.'/'.get_my_template()); $left_content=$tpl->process('','leftcontent',TPL_FINISH | TPL_INCLUDE); $tpl->set_file('middlecontent','register1.html'); $tpl->set_var('name',htmlentities(stripslashes($name))); $tpl->set_var('username',htmlentities(stripslashes($username))); $tpl->set_var('password',htmlentities(stripslashes($password))); $tpl->set_var('password2',htmlentities(stripslashes($password2))); $tpl->set_var('email',htmlentities(stripslashes($email))); $tpl->set_var('email2',htmlentities(stripslashes($email2))); $tpl->set_var('gender_options',vector2options($accepted_genders,$gender,array(_ANY_,_NDISCLOSED_,_CHOOSE_))); $tpl->set_var('country_options',vector2options($accepted_countries,$country,array(_ANY_))); $tpl->set_var('field_state',$field_state); $tpl->set_var('field_city',$field_city); $tpl->set_var('field_zip',$field_zip); $tpl->set_var('field_addr',$field_addr); $tpl->set_var('birthday_options',vector2options($days,$birthday)); $tpl->set_var('birthmonth_options',vector2options($accepted_months,$birthmonth)); $accepted_birthdate_years=create_birthdate_years(); $tpl->set_var('birthyear_options',vector2options($accepted_birthdate_years,$birthyear)); $tpl->set_var('field_mydiz',$field_mydiz); $tpl->set_var('referrer',$referrer); $middle_content=$tpl->process('','middlecontent',TPL_FINISH | TPL_INCLUDE); $tpl->set_file('rightcontent','register_right.html'); $tpl->set_var('tplurl',_TPLURL_.'/'.get_my_template()); $right_content=$tpl->process('','rightcontent',TPL_FINISH | TPL_INCLUDE); $title=$_messages['core'][171]; include('content_frame.php'); ?> this is what i hav edited <? session_cache_limiter('nocache'); session_start(); require_once("includes/templates.inc.php"); require_once("includes/site_functions.inc.php"); require_once("includes/vars.inc.php"); db_connect(_DBHOSTNAME_,_DBUSERNAME_,_DBPASSWORD_,_DBNAME_,_PCONN_); check_login_member(_GUESTLEVEL_); $name=""; $mname=""; $lname=""; $username=""; $password=""; $password2=""; $email=""; $email2=""; $gender=1; $country=1; $state=_NDISCLOSED_; $city=""; $gotra=""; $zip=""; $addr=""; $birthday=_CHOOSE_; $birthmonth=_CHOOSE_; $birthyear=_CHOOSE_; $my_diz=""; $referrer=""; $message=""; if (isset($_SESSION['topass']) && !empty($_SESSION['topass'])) { $topass=$_SESSION['topass']; $_SESSION['topass']=""; $name=((isset($topass['name'])) ? ($topass['name']) : ("")); $mname=((isset($topass['mname'])) ? ($topass['mname']) : ("")); $lname=((isset($topass['lname'])) ? ($topass['lname']) : ("")); $username=((isset($topass['username'])) ? ($topass['username']) : ("")); $password=((isset($topass['password'])) ? ($topass['password']) : ("")); $password2=((isset($topass['password2'])) ? ($topass['password2']) : ("")); $email=((isset($topass['email'])) ? ($topass['email']) : ("")); $email2=((isset($topass['email2'])) ? ($topass['email2']) : ("")); $gender=((isset($topass['gender'])) ? ($topass['gender']) : (1)); $country=((isset($topass['country'])) ? ($topass['country']) : (1)); $state=((isset($topass['state'])) ? ($topass['state']) : (1)); $city=((isset($topass['city'])) ? ($topass['city']) : ("")); $gotra=((isset($topass['gotra'])) ? ($topass['gotra']) : ("")); $zip=((isset($topass['zip'])) ? ($topass['zip']) : ("")); $addr=((isset($topass['addr'])) ? ($topass['addr']) : ("")); $birthday=((isset($topass['birthday'])) ? ($topass['birthday']) : (_CHOOSE_)); $birthmonth=((isset($topass['birthmonth'])) ? ($topass['birthmonth']) : (_CHOOSE_)); $birthyear=((isset($topass['birthyear'])) ? ($topass['birthyear']) : (_CHOOSE_)); $my_diz=((isset($topass['my_diz'])) ? ($topass['my_diz']) : ("")); // referrer could come in url as well as from a previous error $referrer=isset($topass['referrer']) ? $topass['referrer'] : ""; $message=((isset($topass['message'])) ? ($topass['message']) : ("")); } elseif ($_SERVER['REQUEST_METHOD']=='GET') { $referrer=isset($_GET['referrer']) ? addslashes_mq($_GET['referrer'],true) : ""; } elseif ($_SERVER['REQUEST_METHOD']=='POST') { $name=$_POST['name']; $mname=$_POST['mname']; $lname=$_POST['lname']; $gotra=$_POST['gotra']; $username=$_POST['username']; $password=$_POST['password']; $password2=$_POST['password2']; $email=$_POST['email']; $email2=$_POST['email2']; $gender=$_POST['gender']; $country=$_POST['country']; $city=$_POST['city']; $zip=$_POST['zip']; $addr=$_POST['addr']; $birthday=$_POST['birthday']; $birthmonth=$_POST['birthmonth']; $birthyear=$_POST['birthyear']; $my_diz=$_POST['my_diz']; $referrer=$_POST['referrer']; } $tpl=new phemplate(_TPLPATH_.get_my_template().'/','remove_nonjs'); $field_state=""; if ($fields['users_state'][0] && isset($accepted_states[$country])) { $tpl->set_file('temp','bits/field_state.html'); $tpl->set_var('state_options',vector2options($accepted_states[$country],$state,array(_ANY_))); $field_state=$tpl->process('','temp',TPL_FINISH); } $field_city=""; if ($fields['users_city'][0]) { $tpl->set_file('temp','bits/field_city.html'); $tpl->set_var('city',htmlentities(stripslashes($city))); $field_city=$tpl->process('','temp',TPL_FINISH); } $field_zip=""; if ($fields['users_zip'][0]) { $tpl->set_file('temp','bits/field_zip.html'); $tpl->set_var('zip',htmlentities(stripslashes($zip))); $field_zip=$tpl->process('','temp',TPL_FINISH); } $field_addr=""; if ($fields['users_addr'][0]) { $tpl->set_file('temp','bits/field_addr.html'); $tpl->set_var('addr',htmlentities(stripslashes($addr))); $field_addr=$tpl->process('','temp',TPL_FINISH); } $field_mydiz=""; if ($fields['users_my_diz'][0]) { $tpl->set_file('temp','bits/field_mydiz.html'); $tpl->set_var('max_text_length',get_site_option('max_text_length')); $tpl->set_var('my_diz',htmlentities(stripslashes($my_diz))); $field_mydiz=$tpl->process('','temp',TPL_FINISH); } $tpl->set_file('leftcontent','register_left.html'); $tpl->set_var('tplurl',_TPLURL_.'/'.get_my_template()); $left_content=$tpl->process('','leftcontent',TPL_FINISH | TPL_INCLUDE); $tpl->set_file('middlecontent','register1.html'); $tpl->set_var('name',htmlentities(stripslashes($name))); $tpl->set_var('mname',htmlentities(stripslashes($mname))); $tpl->set_var('lname',htmlentities(stripslashes($lname))); $tpl->set_var('gotra',htmlentities(stripslashes($gotra))); $tpl->set_var('username',htmlentities(stripslashes($username))); $tpl->set_var('password',htmlentities(stripslashes($password))); $tpl->set_var('password2',htmlentities(stripslashes($password2))); $tpl->set_var('email',htmlentities(stripslashes($email))); $tpl->set_var('email2',htmlentities(stripslashes($email2))); $tpl->set_var('gender_options',vector2options($accepted_genders,$gender,array(_ANY_,_NDISCLOSED_,_CHOOSE_))); $tpl->set_var('country_options',vector2options($accepted_countries,$country,array(_ANY_))); $tpl->set_var('field_state',$field_state); $tpl->set_var('field_city',$field_city); $tpl->set_var('field_zip',$field_zip); $tpl->set_var('field_addr',$field_addr); $tpl->set_var('birthday_options',vector2options($days,$birthday)); $tpl->set_var('birthmonth_options',vector2options($accepted_months,$birthmonth)); $accepted_birthdate_years=create_birthdate_years(); $tpl->set_var('birthyear_options',vector2options($accepted_birthdate_years,$birthyear)); $tpl->set_var('field_mydiz',$field_mydiz); $tpl->set_var('referrer',$referrer); $middle_content=$tpl->process('','middlecontent',TPL_FINISH | TPL_INCLUDE); $tpl->set_file('rightcontent','register_right.html'); $tpl->set_var('tplurl',_TPLURL_.'/'.get_my_template()); $right_content=$tpl->process('','rightcontent',TPL_FINISH | TPL_INCLUDE); $title=$_messages['core'][171]; include('content_frame.php'); ?> Link to comment https://forums.phpfreaks.com/topic/102993-need-help-to-add-field/ Share on other sites More sharing options...
mrdamien Posted April 26, 2008 Share Posted April 26, 2008 Well: A) Make sure you added the corresponding fields to your database. B) You need to edit your query to reflect the changes to your new structure. (I.e. add the mname/lname fields/values in your INSERT query); If you post the query/database part that will be more helpful. Link to comment https://forums.phpfreaks.com/topic/102993-need-help-to-add-field/#findComment-527609 Share on other sites More sharing options...
born4flirt Posted April 26, 2008 Author Share Posted April 26, 2008 this is moi processors of registration <? session_cache_limiter('nocache'); session_start(); require_once("../includes/templates.inc.php"); require_once("../includes/site_functions.inc.php"); require_once("../includes/vars.inc.php"); if (isset($_REQUEST['step']) && !empty($_REQUEST['step'])) { $step=addslashes_mq($_REQUEST['step']); $error=false; db_connect(_DBHOSTNAME_,_DBUSERNAME_,_DBPASSWORD_,_DBNAME_,_PCONN_); $topass=array(); if ($step==1) { $name=addslashes_mq($_POST['name']); $mname=addslashes_mq($_POST['mname']); $lname=addslashes_mq($_POST['lname']); $gotra=addslashes_mq($_POST['gotra']); $username=addslashes_mq($_POST['username'],true); $password=addslashes_mq($_POST['password']); $password2=addslashes_mq($_POST['password2']); $email=addslashes_mq($_POST['email'],true); $email2=addslashes_mq($_POST['email2'],true); $gender=addslashes_mq($_POST['gender']); $referrer=isset($_POST['referrer']) ? addslashes_mq($_POST['referrer'],true) : ''; $country=addslashes_mq($_POST['country']); $state=0; if ($fields['users_state'][0] && isset($accepted_states[$country]) && isset($_POST['state']) && !empty($_POST['state'])) { $state=(isset($accepted_states[$country][addslashes_mq($_POST['state'])])) ? addslashes_mq($_POST['state']) : 0; if ($fields['users_state'][1] && $state<=0) { $error=true; $message=$_messages['core'][2]; } } $city=""; if ($fields['users_city'][0]) { $city=addslashes_mq($_POST['city'],true); if ($fields['users_city'][1] && empty($city)) { $error=true; $message=$_messages['core'][3]; } } $zip=""; if ($fields['users_zip'][0]) { $zip=addslashes_mq($_POST['zip'],true); if ($fields['users_zip'][1] && empty($zip)) { $error=true; $message=$_messages['core'][4]; } } $addr=""; if ($fields['users_addr'][0]) { $addr=addslashes_mq($_POST['addr'],true); if ($fields['users_addr'][1] && empty($addr)) { $error=true; $message=$_messages['core'][5]; } } $birthmonth=addslashes_mq($_POST['birthmonth']); $birthday=addslashes_mq($_POST['birthday']); $birthyear=addslashes_mq($_POST['birthyear']); $birthdate=$birthyear."-".$birthmonth."-".$birthday; $my_diz=""; if ($fields['users_my_diz'][0]) { $my_diz=substr(addslashes_mq($_POST['my_diz'],true),0,get_site_option('max_text_length')); if ($fields['users_my_diz'][1] && empty($my_diz)) { $error=true; $message=$_messages['core'][6]; } } if (!empty($name) && (strlen($name)>=3) && preg_match("/[^a-zA-Z0-9-_]/",$name)===0) { $query="SELECT fk_user_id FROM user_details WHERE LOWER(name)='".strtolower($name)."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} if (mysql_num_rows($res)) { $error=true; $message=$_messages['core'][7]; } } else { $error=true; $message=$_messages['core'][8]; } if (!empty($username) && (strlen($username)>=3) && preg_match("/[^a-zA-Z0-9-_]/",$username)===0) { $query="SELECT user_id FROM accounts WHERE LOWER(user)='".strtolower($username)."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} if (mysql_num_rows($res)) { $error=true; $message=$_messages['core'][9]; } } else { $error=true; $message=$_messages['core'][10]; } if (empty($password) || (strlen($password)<3)) { $error=true; $message=$_messages['core'][11]; } if (empty($email)) { $error=true; $message=$_messages['core'][12]; } if ($email2!=$email) { $error=true; $message=$_messages['core'][13]; } if ($password2!=$password) { $error=true; $message=$_messages['core'][14]; } if (get_site_option('unique_emails')==1) { $query="SELECT user_id FROM accounts WHERE LOWER(email)='".strtolower($email)."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} if (mysql_num_rows($res)) { $error=true; $message=$_messages['core'][52]; } } $topass=array(); if (!$error) { $key=time(); // Handle referral $ref_id=0; if (!empty($referrer)) { $query="SELECT fk_user_id FROM user_details WHERE LOWER(name)='".strtolower($referrer)."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} if (mysql_num_rows($res)) { $ref_id=mysql_result($res,0,0); $query="UPDATE user_details SET referralpoints=referralpoints+1 WHERE fk_user_id='$ref_id'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} } } // End Handle referral $query="INSERT INTO accounts SET status="._STATUSNOTCONFIRMED_.",joindate=now(),access_key='$key',user='$username',pass='$password',email='$email'"; $trial_length=get_site_option('trial_length'); if (get_site_option('enable_trials') && !empty($trial_length)) { $query.=",membership="._TEMPPAIDLEVEL_.",paid_until=now()+INTERVAL ".$trial_length." DAY"; } else { $query.=",membership="._FREELEVEL_; } if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} $reg_id=mysql_insert_id(); $query="INSERT INTO user_details SET fk_user_id='$reg_id',name='$name',gender='$gender',country='$country',state='$state',city='$city',birthdate='$birthdate',my_diz='$my_diz',referrer_id='$ref_id',zip='$zip',addr='$addr'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} $_SESSION['reg_id']=$reg_id; $_SESSION['reg_name']=$name; $_SESSION['reg_email']=$email; $_SESSION['reg_username']=$username; $_SESSION['reg_password']=$password; $query="INSERT INTO user_settings SET fk_user_id='$reg_id',email_send_news=1,email_send_alerts=1,email_send_matches=0,album_private=0,feature_me=1,hide_me=0,rate_me=1"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} if (defined('_ADDON_FORUM_') && _ADDON_FORUM_!=0) { forum_insert_member($reg_id,$name,$password,$email); } if (get_site_option('signup_alerts')) { send_newsignup_alert($name,$email,$accepted_genders[$gender]); } $nextstep="registration2.php"; } if ($error) { $topass['message']=$message; $topass['name']=$name; $topass['mname']=$mname; $topass['lname']=$lname; $topass['gotra']=$gotra; $topass['username']=$username; $topass['password']=$password; $topass['password2']=$password2; $topass['email']=$email; $topass['email2']=$email2; $topass['gender']=$gender; $topass['country']=$country; if ($fields['users_state'][0]) { $topass['state']=$state; } if ($fields['users_city'][0]) { $topass['city']=$city; } if ($fields['users_zip'][0]) { $topass['zip']=$zip; } if ($fields['users_addr'][0]) { $topass['addr']=$addr; } $topass['birthday']=$birthday; $topass['birthmonth']=$birthmonth; $topass['birthyear']=$birthyear; if ($fields['users_my_diz'][0]) { $topass['my_diz']=$my_diz; } $topass['referrer']=$referrer; $nextstep="registration1.php"; } redirect2page($nextstep,$topass); } elseif ($step==2) { $connection=0; if ($fields['users_connection'][0]) { $connection=addslashes_mq($_POST['connection']); if ($fields['users_connection'][1] && (empty($connection))) { $error=true; $message=$_messages['core'][15]; } } $looking_for=0; if ($fields['users_looking_for'][0]) { $looking_for=addslashes_mq($_POST['looking_for']); if ($fields['users_looking_for'][1] && (empty($looking_for))) { $error=true; $message=$_messages['core'][16]; } } $your_diz=""; if ($fields['users_your_diz'][0]) { $your_diz=substr(addslashes_mq($_POST['your_diz']),0,get_site_option('max_text_length')); if ($fields['users_your_diz'][1] && empty($your_diz)) { $error=true; $message=$_messages['core'][17]; } } $query="UPDATE user_details SET connection='$connection',looking_for='$looking_for',your_diz='$your_diz' WHERE fk_user_id='".$_SESSION['reg_id']."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} redirect2page("registration3.php"); } elseif ($step==3) { $error=false; $topass=array(); $message=''; $photo=""; if (is_uploaded_file($_FILES['photo']['tmp_name'])) { $photo=addslashes_mq($_FILES['photo']['name']); $ext=strtolower(substr(strrchr($_FILES['photo']['name'],"."),1)); if (!in_array($ext,$accepted_upload_extensions)) { $error=true; $message.=$_messages['core'][18]; } elseif ($_FILES['photo']['size']==0) { $error=true; $message.=$_messages['core'][19]; } else { $photo=$_SESSION['reg_id']."_photo.$ext"; if (!is_writable(_IMAGESPATH_)) { @chmod(_IMAGESPATH_,0755); if (!is_writable(_IMAGESPATH_)) { @chmod(_IMAGESPATH_,0777); } } if (!is_writable(_IMAGESPATH_)) { $error=true; $topass['message']=$_messages['core'][96]; } else { if (!move_uploaded_file($_FILES['photo']['tmp_name'],_IMAGESPATH_.'/'.$photo)) { $error=true; $message=$_messages['core'][20]; $photo=''; } else { @chmod(_IMAGESPATH_."/$photo",0644); if (defined('_ADDON_THUMBS_')) { convert2thumb($photo); } } } } } if (!$error) { $query="UPDATE user_details SET photo='$photo' WHERE fk_user_id='".$_SESSION['reg_id']."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} $nextstep="registration4.php"; } else { $topass['message']=$message; $nextstep="registration3.php"; } redirect2page($nextstep,$topass); } elseif ($step==4) { $topass=array(); $ethnic=""; if ($fields['users_ethnic'][0]) { $ethnic=addslashes_mq($_POST['ethnic']); if ($fields['users_ethnic'][1] && ($ethnic<=0)) { $error=true; $topass['message']=$_messages['core'][21]; } } $looks=""; if ($fields['users_looks'][0]) { $looks=addslashes_mq($_POST['looks']); if ($fields['users_looks'][1] && ($looks<0)) { $error=true; $topass['message']=$_messages['core'][22]; } } $body=""; if ($fields['users_body'][0]) { $body=addslashes_mq($_POST['body']); if ($fields['users_body'][1] && ($body<0)) { $error=true; $topass['message']=$_messages['core'][23]; } } $height=""; if ($fields['users_height'][0]) { $height=addslashes_mq($_POST['height']); if ($fields['users_height'][1] && ($height<0)) { $error=true; $topass['message']=$_messages['core'][24]; } } $weight=""; if ($fields['users_weight'][0]) { $weight=addslashes_mq($_POST['weight']); if ($fields['users_weight'][1] && ($weight<0)) { $error=true; $topass['message']=$_messages['core'][25]; } } $hair=""; if ($fields['users_hair'][0]) { $hair=addslashes_mq($_POST['hair']); if ($fields['users_hair'][1] && ($hair<0)) { $error=true; $topass['message']=$_messages['core'][26]; } } $eyes=""; if ($fields['users_eyes'][0]) { $eyes=addslashes_mq($_POST['eyes']); if ($fields['users_eyes'][1] && ($eyes<0)) { $error=true; $topass['message']=$_messages['core'][27]; } } $smoking=""; if ($fields['users_smoking'][0]) { $smoking=addslashes_mq($_POST['smoking']); if ($fields['users_smoking'][1] && ($smoking<0)) { $error=true; $topass['message']=$_messages['core'][28]; } } $drinking=""; if ($fields['users_drinking'][0]) { $drinking=addslashes_mq($_POST['drinking']); if ($fields['users_drinking'][1] && ($drinking<0)) { $error=true; $topass['message']=$_messages['core'][29]; } } $partying=""; if ($fields['users_partying'][0]) { $partying=addslashes_mq($_POST['partying']); if ($fields['users_partying'][1] && ($partying<0)) { $error=true; $topass['message']=$_messages['core'][30]; } } $sexpractices=""; if ($fields['users_sexpractices'][0]) { $sexpractices=addslashes_mq($_POST['sexpractices']); if ($fields['users_sexpractices'][1] && ($sexpractices<0)) { $error=true; $topass['message']=$_messages['core'][31]; } } $marital=""; if ($fields['users_maritalstatus'][0]) { $marital=addslashes_mq($_POST['marital']); if ($fields['users_maritalstatus'][1] && ($marital<0)) { $error=true; $topass['message']=$_messages['core'][32]; } } $children=""; if ($fields['users_children'][0]) { $children=addslashes_mq($_POST['children']); if ($fields['users_children'][1] && ($children<0)) { $error=true; $topass['message']=$_messages['core'][33]; } } $profession=""; if ($fields['users_profession'][0]) { $profession=addslashes_mq($_POST['profession']); if ($fields['users_profession'][1] && ($profession<0)) { $error=true; $topass['message']=$_messages['core'][34]; } } $education=""; if ($fields['users_education'][0]) { $education=addslashes_mq($_POST['education']); if ($fields['users_education'][1] && ($education<0)) { $error=true; $topass['message']=$_messages['core'][35]; } } $religion=""; if ($fields['users_religion'][0]) { $religion=addslashes_mq($_POST['religion']); if ($fields['users_religion'][1] && ($religion<0)) { $error=true; $topass['message']=$_messages['core'][36]; } } $seriousrel=""; if ($fields['users_seriousrel'][0]) { $seriousrel=addslashes_mq($_POST['seriousrel']); if ($fields['users_seriousrel'][1] && ($seriousrel<0)) { $error=true; $topass['message']=$_messages['core'][37]; } } $reading=""; if ($fields['users_reading'][0]) { $reading=addslashes_mq($_POST['reading']); if ($fields['users_reading'][1] && ($reading<0)) { $error=true; $topass['message']=$_messages['core'][38]; } } $rellength=""; if ($fields['users_rellength'][0]) { $rellength=addslashes_mq($_POST['rellength']); if ($fields['users_rellength'][1] && ($rellength<0)) { $error=true; $topass['message']=$_messages['core'][39]; } } $marriageviews=""; if ($fields['users_marriageviews'][0]) { $marriageviews=addslashes_mq($_POST['marriageviews']); if ($fields['users_marriageviews'][1] && ($marriageviews<0)) { $error=true; $topass['message']=$_messages['core'][40]; } } $drugviews=""; if ($fields['users_drugviews'][0]) { $drugviews=addslashes_mq($_POST['drugviews']); if ($fields['users_drugviews'][1] && ($drugviews<0)) { $error=true; $topass['message']=$_messages['core'][41]; } } $sleptwith=""; if ($fields['users_sleptwith'][0]) { $sleptwith=addslashes_mq($_POST['sleptwith']); if ($fields['users_sleptwith'][1] && ($sleptwith<0)) { $error=true; $topass['message']=$_messages['core'][42]; } } if (!$error) { $query="UPDATE user_details SET ethnic='$ethnic',looks='$looks',body='$body',height='$height',weight='$weight',hair='$hair',eyes='$eyes',smoking='$smoking',drinking='$drinking',partying='$partying',sexpractices='$sexpractices',maritalstatus='$marital',children='$children',profession='$profession',education='$education',religion='$religion',reading='$reading',sleptwith='$sleptwith',drugviews='$drugviews',marriageviews='$marriageviews',seriousrel='$seriousrel',rellength='$rellength' WHERE fk_user_id='".$_SESSION['reg_id']."'"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} $nextstep="registration5.php"; $code=get_key($_SESSION['reg_id']); if (!send_activation_code($_SESSION['reg_id'],$_SESSION['reg_name'],$_SESSION['reg_email'],$code,$_SESSION['reg_username'],$_SESSION['reg_password'])) { $topass['message']=$_messages['core'][314]; } } else { if ($fields['users_ethnic'][0]) { $topass['ethnic']=$ethnic; } if ($fields['users_looks'][0]) { $topass['looks']=$looks; } if ($fields['users_body'][0]) { $topass['body']=$body; } if ($fields['users_height'][0]) { $topass['height']=$height; } if ($fields['users_weight'][0]) { $topass['weight']=$weight; } if ($fields['users_hair'][0]) { $topass['hair']=$hair; } if ($fields['users_eyes'][0]) { $topass['eyes']=$eyes; } if ($fields['users_smoking'][0]) { $topass['smoking']=$smoking; } if ($fields['users_drinking'][0]) { $topass['drinking']=$drinking; } if ($fields['users_partying'][0]) { $topass['partying']=$partying; } if ($fields['users_sexpractices'][0]) { $topass['sexpractices']=$sexpractices; } if ($fields['users_maritalstatus'][0]) { $topass['marital']=$marital; } if ($fields['users_children'][0]) { $topass['children']=$children; } if ($fields['users_profession'][0]) { $topass['profession']=$profession; } if ($fields['users_education'][0]) { $topass['education']=$education; } if ($fields['users_religion'][0]) { $topass['religion']=$religion; } if ($fields['users_rellength'][0]) { $topass['rellength']=$rellength; } if ($fields['users_seriousrel'][0]) { $topass['seriousrel']=$seriousrel; } if ($fields['users_reading'][0]) { $topass['reading']=$reading; } if ($fields['users_sleptwith'][0]) { $topass['sleptwith']=$sleptwith; } if ($fields['users_marriageviews'][0]) { $topass['marriageviews']=$marriageviews; } if ($fields['users_drugviews'][0]) { $topass['drugviews']=$drugviews; } $nextstep="registration4.php"; } redirect2page($nextstep,$topass); } elseif ($step==5) { $code=addslashes_mq($_REQUEST['act_code'],true); $user_id=addslashes_mq($_REQUEST['user_id'],true); $error=false; if ($code!=get_key($user_id)) { $error=true; $message=$_messages['core'][43]; } $topass=array(); if (!$error) { reset_my_approval($user_id); $nextstep="inform_page.php"; $topass['message']=$_messages['core'][1]; $topass['continue_link']="processors/logout.php"; } else { $topass['message']=$message; $nextstep="registration5.php"; } redirect2page($nextstep,$topass); } } ?> Link to comment https://forums.phpfreaks.com/topic/102993-need-help-to-add-field/#findComment-527650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.