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'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/102992-need-help-to-add-field/ Share on other sites More sharing options...
Coreye Posted May 3, 2008 Share Posted May 3, 2008 What field are you trying to add? Quote Link to comment https://forums.phpfreaks.com/topic/102992-need-help-to-add-field/#findComment-532242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.