$field){ $_POST[$key]= mysql_real_escape_string(preg_replace("/<|>|\n|\r|\\\/","",$field)); } $code=$_POST['code']; $img = new Securimage(); $valid = $img->check($code); //-------------------------------MANDITATORY FIELD------------------------------------------- $temple_name=$_POST['temple_name']; $deity_name=$_POST['deity_name']; $temple_type=$_POST['temple_type']; $about_temple=$_POST['about_temple']; $state=$_POST['state']; $city=$_POST['city']; $latitude=$_POST['latitude']; $longitude=$_POST['longitude']; //-----------------------------------OTHER FIELD-------------------------------------- $blockName=$_POST['blockName']; $panchayat=$_POST['panchayat']; $village=$_POST['village']; $street=$_POST['street']; $pincode=$_POST['pincode']; $howto_reach=$_POST['howto_reach']; //-----------------------------------OTHER FIELD-------------------------------------- $opening_time=$_POST['opening_time']; $closing_time=$_POST['closing_time']; $phone=$_POST['phone']; $builded_by=$_POST['builded_by']; $builded_year=$_POST['builded_year']; $publisher_name=$_POST['publisher_name']; $publisher_email=$_POST['publisher_email']; $history=$_POST['history']; $features=$_POST['features']; $worshiped=$_POST['worshiped']; $maintained=$_POST['maintained']; $festivals=$_POST['festivals']; $language=$_POST['language']; $profile_created_date=date("y-m-d h-i-s"); $ip_address=$_SERVER['REMOTE_ADDR']; if(strlen($temple_name)<3) $err_msg.=", Temple name"; if(strlen($deity_name)<3) $err_msg.=", God name"; if(strlen($temple_type)<1) $err_msg.=", Temple category"; if(strlen($about_temple)<5) $err_msg.=", About temple"; if(strlen($state)<1) $err_msg.=", state"; if(strlen($city)<1) $err_msg.=", city"; if(strlen($publisher_name)<1) $err_msg.=", Your Name"; if(strlen($publisher_email)<1) $err_msg.=", Your email"; if(strlen($language)<1) $err_msg.=" language"; if(strlen($profile_created_date)<3) $err_msg.=" profile_created_date"; if(strlen($ip_address)<3) $err_msg.=" ip_address"; if(!$valid) $err_msg.=", CAPTCHA(Security code)"; $fieldList="posteddate,ipaddress,temple_name, deity_name, temple_type, about_temple, state, city"; $valueList="'$profile_created_date','$ip_address','$temple_name', '$deity_name', '$temple_type', '$about_temple', '$state', '$city'"; if(strlen($latitude)>0) { $fieldList.=", lat"; $valueList.=", '$latitude'";} if(strlen($blockName)>0) { $fieldList.=", lon"; $valueList.=", '$longitude'";} if(strlen($blockName)>0) { $fieldList.=", blockname"; $valueList.=", '$blockName'";} if(strlen($panchayat)>0) { $fieldList.=", panchayat"; $valueList.=", '$panchayat'";} if(strlen($village)>0) { $fieldList.=", village"; $valueList.=", '$village'";} if(strlen($street)>0) { $fieldList.=", street"; $valueList.=", '$street'";} if(strlen($pincode)>0) { $fieldList.=", pincode"; $valueList.=", '$pincode'";} if(strlen($howto_reach)>0) { $fieldList.=", howto_reach"; $valueList.=", '$howto_reach'";} if(strlen($opening_time)>0) { $fieldList.=", opening_time"; $valueList.=", '$opening_time'";} if(strlen($closing_time)>0) { $fieldList.=", closing_time"; $valueList.=", '$closing_time'";} if(strlen($phone)>0) { $fieldList.=", phone"; $valueList.=", '$phone'";} if(strlen($builded_by)>0) { $fieldList.=", builded_by"; $valueList.=", '$builded_by'";} if(strlen($builded_year)>0) { $fieldList.=", builded_year"; $valueList.=", '$builded_year'";} if(strlen($publisher_name)>0) { $fieldList.=", publisher_name"; $valueList.=", '$publisher_name'";} if(strlen($publisher_email)>0) { $fieldList.=", publisher_email"; $valueList.=", '$publisher_email'";} if(strlen($history)>0) { $fieldList.=", history"; $valueList.=", '$history'";} if(strlen($features)>0) { $fieldList.=", features"; $valueList.=", '$features'";} if(strlen($worshiped)>0) { $fieldList.=", worshiped"; $valueList.=", '$worshiped'";} if(strlen($maintained)>0) { $fieldList.=", maintained"; $valueList.=", '$maintained'";} if(strlen($festivals)>0) { $fieldList.=", festivals"; $valueList.=", '$festivals'";} if(strlen($language)>0) { $fieldList.=", language"; $valueList.=", '$language'";} $qry="INSERT INTO temple_user($fieldList) VALUES($valueList)"; //echo "