function save_form() { $submitted = 0; assign_values(); upload_all_images(); $save1_query = "UPDATE user_info SET name_applicant = '" . $name_applicant . "',name_father = '" . $name_father . "',permanent_address = '" . $permanent_address . "',present_address = '" . $present_address . "',mobile = '" . $mobile . "',phone_no = '" . $phone_no . "',dob = '" . $dob . "',nationality = '" . $nationality . "',place_birth = '" . $place_birth . "',caste = '" . $caste . "' WHERE reg_id = '" . $reg_id . "' "; $save1_result = mysql_query($save1_query) or die(mysql_error()); $save2_query = "UPDATE user_exams SET exam1_name = '" . $exam_name[0] . "',exam1_year = '" . $exam_year[0] . "',exam1_percentage = '" . $exam_percentage[0] . "',exam1_divn = '" . $exam_divn[0] . "',exam1_institute = '" . $exam_institute[0] . "',exam1_univ = '" . $exam_univ[0] . "', exam2_name = '" . $exam_name[1] . "',exam2_year = '" . $exam_year[1] . "',exam2_percentage = '" . $exam_percentage[1] . "',exam2_divn = '" . $exam_divn[1] . "',exam2_institute = '" . $exam_institute[1] . "',exam2_univ = '" . $exam_univ[1] . "',exam3_name = '" . $exam_name[2] . "',exam3_year = '" . $exam_year[2] . "',exam3_percentage = '" . $exam_percentage[2] . "',exam3_divn = '" . $exam_divn[2] . "',exam3_institute = '" . $exam_institute[2] . "',exam3_univ = '" . $exam_univ[2] . "',exam4_name = '" . $exam_name[3] . "',exam4_year = '" . $exam_year[3] . "',exam4_percentage = '" . $exam_percentage[3] . "',exam4_divn = '" . $exam_divn[3] . "',exam4_institute = '" . $exam_institute[3] . "',exam4_univ = '" . $exam_univ[3] . "',exam5_name = '" . $exam_name[4] . "',exam5_year = '" . $exam_year[4] . "',exam5_percentage = '" . $exam_percentage[4] . "',exam5_divn = '" . $exam_divn[4] . "',exam5_institute = '" . $exam_institute[4] . "',exam5_univ = '" . $exam_univ[4] . "' WHERE reg_id = '" . $reg_id . "' "; $save2_result = mysql_query($save2_query) or die(mysql_error()); $save3_query = "UPDATE user_earlier_posts SET post1_name = '" . $post_name[0] . "',post1_from = '" . $post_from[0] . "',post1_to = '" . $post_to[0] . "',post1_total_year = '" . $post_total_year[0] . "',post1_total_month = '" . $post_total_month[0] . "',post1_pay = '" . $post_pay[0] . "',post2_name = '" . $post_name[1] . "',post2_from = '" . $post_from[1] . "',post2_to = '" . $post_to[1] . "',post2_total_year = '" . $post_total_year[1] . "',post2_total_month = '" . $post_total_month[1] . "',post2_pay = '" . $post_pay[1] . "',post3_name = '" . $post_name[2] . "',post3_from = '" . $post_from[2] . "',post3_to = '" . $post_to[2] . "',post3_total_year = '" . $post_total_year[2] . "',post3_total_month = '" . $post_total_month[2] . "',post3_pay = '" . $post_pay[2] . "',post4_name = '" . $post_name[3] . "',post4_from = '" . $post_from[3] . "',post4_to = '" . $post_to[3] . "',post4_total_year = '" . $post_total_year[3] . "',post4_total_month = '" . $post_total_month[3] . "',post4_pay = '" . $post_pay[3] . "',post5_name = '" . $post_name[4] . "',post5_from = '" . $post_from[4] . "',post5_to = '" . $post_to[4] . "',post5_total_year = '" . $post_total_year[4] . "',post5_total_month = '" . $post_total_month[4] . "',post5_pay = '" . $post_pay[4] . "' WHERE reg_id = '" . $reg_id . "'"; $save3_result = mysql_query($save3_query) or die(mysql_error()); $save4_query = "UPDATE user_other_details SET national_paper_conf_count='" . $national_paper_conf_count . "', national_paper_conf_desc='" . $national_paper_conf_desc . "',international_paper_conf_presented_count='" . $international_paper_conf_presented_count . "',international_paper_conf_presented_desc='" . $international_paper_conf_presented_desc . "',no_paper_published_journal_national='" . $no_paper_published_journal_national . "', no_paper_published_journal_national='" . $no_paper_published_journal_international . "',no_paper_published_books='" . $no_paper_published_books . "', no_paper_published_patents='" . $no_paper_published_patents . "',no_phd_guided_sole='" . $no_phd_guided_sole . "',no_phd_guided_supervisor='" . $no_phd_guided_supervisor . "',no_projects_as_coordinator_sf_completed='" . $no_projects_as_coordinator_sf_completed . "',no_projects_as_coordinator_sf_ongoing='" . $no_projects_as_coordinator_sf_ongoing . "',no_projects_as_coordinator_s_completed='" . $no_projects_as_coordinator_s_completed . "',no_projects_as_coordinator_s_ongoing='" . $no_projects_as_coordinator_s_ongoing . "',particulars_prof_exp_other='" . $particulars_prof_exp_other . "',certificates='" . $certificates . "',submitted='" . $submitted . "' WHERE reg_id='" . $reg_id . "'"; $save4_result = mysql_query($save4_query) or die(mysql_error()); }
<?php $field_keys = array('name', 'email', 'phone', 'method', 'message'); $values = array(); $labels = array('name' => 'Name:', 'email' => 'Email Address:', 'phone' => 'Phone Number:', 'method' => 'Preferred Contact Method:', 'message' => 'Message:'); $e_class = array(); $e_class['name'] = $e_class['email'] = $e_class['message'] = ''; $is_valid = FALSE; $thanks = NULL; assign_values($values, $field_keys); if (!empty($_POST)) { assign_values($values, $field_keys, $_POST); // strip html from plain text fields $no_tags_fields = array('name', 'phone', 'method', 'message'); foreach ($no_tags_fields as $ntf) { if (isset($values[$ntf])) { $values[$ntf] = strip_tags($values[$ntf]); } } // validate the form $errors = set_errors($values); if (count($errors) == 0) { $is_valid = TRUE; } else { foreach ($errors as $fk) { $e_class[$fk] = ' error'; } } // If valid, build the message, send it, and build the thanks if ($is_valid) { $to = '*****@*****.**';