Guest User

It's done

a guest
Jul 28th, 2014
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $flag = 0;
  3. $flag1 = 0;
  4. $flag2 = 0;
  5. $flag3 = 0;
  6. $disastervoln1 = "";
  7. $scounty1= "";
  8. $vskills1 = "";
  9. $etrain1 = "";
  10. $fname = filter_input(INPUT_POST, 'fname', FILTER_SANITIZE_STRING);
  11. $middle = filter_input(INPUT_POST, 'middle', FILTER_SANITIZE_STRING);
  12. $lname = filter_input(INPUT_POST, 'lname', FILTER_SANITIZE_STRING);
  13. $address = filter_input(INPUT_POST, 'address', FILTER_SANITIZE_STRING);
  14. $city = filter_input(INPUT_POST, 'city', FILTER_SANITIZE_STRING);
  15. $state = filter_input(INPUT_POST, 'state', FILTER_SANITIZE_STRING);
  16. $zip = filter_input(INPUT_POST, 'zip', FILTER_SANITIZE_STRING);
  17. $county = filter_input(INPUT_POST, 'county', FILTER_SANITIZE_STRING);
  18. $mailing = filter_input(INPUT_POST, 'mailing', FILTER_SANITIZE_STRING);
  19. $hphone = filter_input(INPUT_POST, 'hphone', FILTER_SANITIZE_STRING);
  20. $mphone = filter_input(INPUT_POST, 'mphone', FILTER_SANITIZE_STRING);
  21. $wphone = filter_input(INPUT_POST, 'wphone', FILTER_SANITIZE_STRING);
  22. $ext = filter_input(INPUT_POST, 'ext', FILTER_SANITIZE_STRING);
  23. $fax = filter_input(INPUT_POST, 'fax', FILTER_SANITIZE_STRING);
  24. $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
  25. $ethgroup = filter_input(INPUT_POST, 'ethgroup', FILTER_SANITIZE_STRING);
  26. $other1 = filter_input(INPUT_POST, 'other1', FILTER_SANITIZE_STRING);
  27. $occupation = filter_input(INPUT_POST, 'occupation', FILTER_SANITIZE_STRING);
  28. $poe = filter_input(INPUT_POST, 'poe', FILTER_SANITIZE_STRING);
  29. $dob = filter_input(INPUT_POST, 'dob', FILTER_SANITIZE_NUMBER_INT);
  30. $gender = filter_input(INPUT_POST, 'gender', FILTER_SANITIZE_STRING);
  31. $disastervoln = $_POST["disastervoln"];
  32. $scounty = $_POST["scounty"];
  33. $other2 = filter_input(INPUT_POST, 'other2', FILTER_SANITIZE_STRING);
  34. $vskills = $_POST["vSkills"];
  35. $interpt = filter_input(INPUT_POST, 'interpt', FILTER_SANITIZE_STRING);
  36. $cdl = filter_input(INPUT_POST, 'cdl', FILTER_SANITIZE_STRING);
  37. $cpryn = filter_input(INPUT_POST, 'cpryn', FILTER_SANITIZE_STRING);
  38. $faid = filter_input(INPUT_POST, 'faid', FILTER_SANITIZE_STRING);
  39. $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
  40. $other3 = filter_input(INPUT_POST, 'other3', FILTER_SANITIZE_STRING);
  41. $license1 = filter_input(INPUT_POST, 'license1', FILTER_SANITIZE_STRING);
  42. $verf1 = filter_input(INPUT_POST, 'verf1',FILTER_SANITIZE_NUMBER_INT);
  43. $num1 = filter_input(INPUT_POST, 'num1', FILTER_SANITIZE_STRING);
  44. $exp1 = filter_input(INPUT_POST, 'exp1', FILTER_SANITIZE_NUMBER_INT);
  45. $license2 = filter_input(INPUT_POST, 'license2', FILTER_SANITIZE_STRING);
  46. $verf2 = filter_input(INPUT_POST, 'verf2', FILTER_SANITIZE_NUMBER_INT);
  47. $num2 = filter_input(INPUT_POST, 'num2', FILTER_SANITIZE_STRING);
  48. $exp2 = filter_input(INPUT_POST, 'exp2', FILTER_SANITIZE_NUMBER_INT);
  49. $license3 = filter_input(INPUT_POST, 'license3', FILTER_SANITIZE_STRING);
  50. $verf3 = filter_input(INPUT_POST, 'verf3', FILTER_SANITIZE_NUMBER_INT);
  51. $num3 = filter_input(INPUT_POST, 'num3', FILTER_SANITIZE_STRING);
  52. $exp3 = filter_input(INPUT_POST, 'exp3', FILTER_SANITIZE_NUMBER_INT);
  53. $license4 = filter_input(INPUT_POST, 'license4', FILTER_SANITIZE_STRING);
  54. $verf4 = filter_input(INPUT_POST, 'verf4', FILTER_SANITIZE_NUMBER_INT);
  55. $num4 = filter_input(INPUT_POST, 'num4', FILTER_SANITIZE_STRING);
  56. $exp4 = filter_input(INPUT_POST, 'exp4', FILTER_SANITIZE_NUMBER_INT);
  57. $license5 = filter_input(INPUT_POST, 'license5', FILTER_SANITIZE_STRING);
  58. $verf5 = filter_input(INPUT_POST, 'verf5', FILTER_SANITIZE_NUMBER_INT);
  59. $num5 = filter_input(INPUT_POST, 'num5', FILTER_SANITIZE_STRING);
  60. $exp5 = filter_input(INPUT_POST, 'exp5', FILTER_SANITIZE_NUMBER_INT);
  61. $lsrd = filter_input(INPUT_POST, 'lsrd', FILTER_SANITIZE_STRING);
  62. $syes = filter_input(INPUT_POST, 'syes', FILTER_SANITIZE_STRING);
  63. $bcert = filter_input(INPUT_POST, 'bcert', FILTER_SANITIZE_STRING);
  64. $pauth = filter_input(INPUT_POST, 'pauth', FILTER_SANITIZE_STRING);
  65. $etrain = $_POST["etrain"];
  66. $dist1 = filter_input(INPUT_POST, 'dist1', FILTER_SANITIZE_STRING);
  67. $tdate1 = filter_input(INPUT_POST, 'tdate1', FILTER_SANITIZE_NUMBER_INT);
  68. $dist2 = filter_input(INPUT_POST, 'dist2', FILTER_SANITIZE_STRING);
  69. $tdate2 = filter_input(INPUT_POST, 'tdate2', FILTER_SANITIZE_NUMBER_INT);
  70. $dist3 = filter_input(INPUT_POST, 'dist3', FILTER_SANITIZE_STRING);
  71. $tdate3 = filter_input(INPUT_POST, 'tdate3', FILTER_SANITIZE_NUMBER_INT);
  72. $dist4 = filter_input(INPUT_POST, 'dist4', FILTER_SANITIZE_STRING);
  73. $tdate4 = filter_input(INPUT_POST, 'tdate4', FILTER_SANITIZE_NUMBER_INT);
  74. $dist5 = filter_input(INPUT_POST, 'dist5', FILTER_SANITIZE_STRING);
  75. $tdate5 = filter_input(INPUT_POST, 'tdate5', FILTER_SANITIZE_NUMBER_INT);
  76. $felony = filter_input(INPUT_POST, 'felony', FILTER_SANITIZE_STRING);
  77. $felonys = filter_input(INPUT_POST, 'felonys', FILTER_SANITIZE_STRING);
  78. $ehome = filter_input(INPUT_POST, 'ehome', FILTER_SANITIZE_STRING);
  79. $erelationship = filter_input(INPUT_POST, 'erelationship', FILTER_SANITIZE_STRING);
  80. $ehphone = filter_input(INPUT_POST, 'ehphone', FILTER_SANITIZE_STRING);
  81. $eaddress = filter_input(INPUT_POST, 'eaddress', FILTER_SANITIZE_STRING);
  82. $ecity = filter_input(INPUT_POST, 'ecity', FILTER_SANITIZE_STRING);
  83. $ezip = filter_input(INPUT_POST, 'ezip', FILTER_SANITIZE_STRING);
  84. $hdyhau = filter_input(INPUT_POST, 'hdyhau', FILTER_SANITIZE_STRING);
  85. $bdesc = filter_input(INPUT_POST, 'bdesc', FILTER_SANITIZE_STRING);
  86.  
  87. foreach($disastervoln as $entry){
  88.     $disastervoln1 .= $entry.",";
  89.     $flag = 1;
  90. }
  91. if ($flag == 1){
  92.     $disastervoln1 =rtrim($disastervoln1);
  93. }
  94. foreach($scounty as $entry1){
  95.     $scounty1 .= $entry1.",";
  96.     $flag1 = 1;
  97. }
  98. if ($flag1 == 1){
  99.     $scounty1 =rtrim($scounty1);
  100. }foreach($vskills as $entry2){
  101.     $vskills1 .= $entry2.",";
  102.     $flag2 = 1;
  103. }
  104. if ($flag2 == 1){
  105.     $vskills1 =rtrim($vskills1);
  106. }
  107. foreach($etrain as $entry3){
  108.     $etrain1 .= $entry3.",";
  109.     $flag3 = 1;
  110. }
  111. if ($flag3 == 1){
  112.     $etrain1 =rtrim($etrain1);
  113. }
  114.  
  115. $dbh = new PDO('mysql:host=localhost;dbname=petrzilk_test', 'petrzilk_dbAdmin', '#######');
  116. $stmt = $dbh->prepare("insert into VolunDB(fname, middle, lname, address, city, state, zip, county, mailing, hphone, ,mphone, wphone, ext, fax, email, ethgroup, other1, occupation, poe, dob, gender, disastervoln, scounty, other2, vskills, interpt, cdl, cpryn, faid, translate, other3, license1, verf1, num1, exp1, license2, verf2, num2, exp2, license3, verf3, num3, exp3, license4, verf4, num4, exp4, license5, verf5, num5, exp5, lsrd, syes, bcert, pauth, etrain, dist1, tdate1, dist2, tdate2, dist3, tdate3, dist4, tdate4, dist5, tdate5, felony, felonys, ehome, erelationship, ehphone, eaddress, ecity, ezip, hdyhau, bdesc) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
  117. $stmt->bindParam(1, $fname);
  118. $stmt->bindParam(1, $middle );
  119. $stmt->bindParam(1, $lname );
  120. $stmt->bindParam(1, $address );
  121. $stmt->bindParam(1, $city);
  122. $stmt->bindParam(1, $zip);
  123. $stmt->bindParam(1, $county);
  124. $stmt->bindParam(1, $mailing);
  125. $stmt->bindParam(1, $hphone);
  126. $stmt->bindParam(1, $mphone);
  127. $stmt->bindParam(1, $wphone);
  128. $stmt->bindParam(1, $ext);
  129. $stmt->bindParam(1, $fax);
  130. $stmt->bindParam(1, $email);
  131. $stmt->bindParam(1, $ethgroup);
  132. $stmt->bindParam(1, $other1);
  133. $stmt->bindParam(1, $occupation);
  134. $stmt->bindParam(1, $poe);
  135. $stmt->bindParam(1, $dob);
  136. $stmt->bindParam(1, $gender);
  137. $stmt->bindParam(1, $disastervoln1);
  138. $stmt->bindParam(1, $scounty1);
  139. $stmt->bindParam(1, $other2);
  140. $stmt->bindParam(1, $vskills1);
  141. $stmt->bindParam(1, $interpt);
  142. $stmt->bindParam(1, $cdl);
  143. $stmt->bindParam(1, $cpryn);
  144. $stmt->bindParam(1, $faid);
  145. $stmt->bindParam(1, $translate);
  146. $stmt->bindParam(1, $other3);
  147. $stmt->bindParam(1, $license1);
  148. $stmt->bindParam(1, $verf1);
  149. $stmt->bindParam(1, $num1);
  150. $stmt->bindParam(1, $exp1);
  151. $stmt->bindParam(1, $license2);
  152. $stmt->bindParam(1, $verf2);
  153. $stmt->bindParam(1, $num2);
  154. $stmt->bindParam(1, $exp2);
  155. $stmt->bindParam(1, $license3);
  156. $stmt->bindParam(1, $verf3);
  157. $stmt->bindParam(1, $num3);
  158. $stmt->bindParam(1, $exp3 );
  159. $stmt->bindParam(1, $license4);
  160. $stmt->bindParam(1, $verf4);
  161. $stmt->bindParam(1, $num4);
  162. $stmt->bindParam(1, $exp4);
  163. $stmt->bindParam(1, $license5);
  164. $stmt->bindParam(1, $verf5);
  165. $stmt->bindParam(1, $num5);
  166. $stmt->bindParam(1, $exp5);
  167. $stmt->bindParam(1, $lsrd);
  168. $stmt->bindParam(1, $syes);
  169. $stmt->bindParam(1, $bcert);
  170. $stmt->bindParam(1, $pauth);
  171. $stmt->bindParam(1, $etrain1);
  172. $stmt->bindParam(1, $dist1);
  173. $stmt->bindParam(1, $tdate1);
  174. $stmt->bindParam(1, $dist2);
  175. $stmt->bindParam(1, $tdate2);
  176. $stmt->bindParam(1, $dist3);
  177. $stmt->bindParam(1, $tdate3);
  178. $stmt->bindParam(1, $dist4);
  179. $stmt->bindParam(1, $tdate4);
  180. $stmt->bindParam(1, $dist5);
  181. $stmt->bindParam(1, $tdate5);
  182. $stmt->bindParam(1, $felony);
  183. $stmt->bindParam(1, $felonys);
  184. $stmt->bindParam(1, $ehome);
  185. $stmt->bindParam(1, $erelationship);
  186. $stmt->bindParam(1, $ehphone);
  187. $stmt->bindParam(1, $eaddress);
  188. $stmt->bindParam(1, $ecity);
  189. $stmt->bindParam(1, $ezip);
  190. $stmt->bindParam(1, $hdyhau);
  191. $stmt->bindParam(1, $bdesc);
  192. $stmt->execute();
  193. echo "<p>The user has been added.</p>";
  194. echo "\nPDOStatement::errorInfo():\n";
  195. $arr = $stmt->errorInfo();
  196. print_r($arr);
  197.  
  198. ?>
RAW Paste Data