Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. if(isset($_REQUEST["submit_newlaw"]))
  2. {
  3. $file=$_FILES["file"]["name"];
  4.  
  5. $court = $_POST['court'];
  6. $citation = $_POST['citation'];
  7. $appelant = $_POST['appelant'];
  8. $opponent = $_POST['opponent'];
  9. $judge = $_POST['judge'];
  10. $judgement = $_POST['judgement'];
  11. $reference = $_POST['reference'];
  12. $year = $_POST['year'];
  13. $detail = $_POST['detail'];
  14.  
  15. $tmp_name=$_FILES["file"]["tmp_name"];
  16. $path="../case_laws/new/".$file;
  17. $file1=explode(".",$file);
  18. $ext=$file1[1];
  19. $allowed=array("jpg","png","pdf","pdf","docx","doc");
  20. if(in_array($ext,$allowed))
  21. {
  22. move_uploaded_file($tmp_name,$path);
  23. $sql = "insert into new_caselaws(id, court, citation, appelant, opponent,
  24. judge, judgement, reference, year, detail,file)values('', '$court',
  25. '$citation', '$appelant', '$opponent', '$judge', '$judgement',
  26. '$reference', '$year', '$detail','$file')";
  27. mysqli_query($db, $sql);
  28. echo "Successfull";
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement