Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $(document).ready(function() {
  4.  
  5. $("#videoToUpload").click(function() {
  6.  
  7. var vidName = $("#vidName").val();
  8. var videoDescription = $("#videoDescription").val();
  9. var albumName1 = $("#choosevidCat").val();
  10. var vidFile =$("#video").val();
  11.  
  12. // Put an animated GIF image insight of content
  13. $("#loader").empty().html('<img src="/images/loader.gif" class="vidloader1"/>');
  14.  
  15. $.post("includes/vid_upload.inc.php",{vidName: vidName, videoDescription: videoDescription, albumName1: albumName1, vidFile: vidFile}, function(json)
  16. {
  17.  
  18. if(json.result === "success") {
  19.  
  20. $("#viduploadResult").html( "The Video "+vidName+" has been Uploaded!");
  21.  
  22.  
  23. // // First remove all the existing options
  24. // $('#choosevidCat').empty();
  25. //
  26. // // Load the content:
  27. // $('#choosevidCat').load(location.href + "#choosevidCat > *");
  28.  
  29. }else{
  30. $("#viduploadResult").html(json.message);
  31. }
  32.  
  33. });
  34. });
  35. })
  36. </script>
  37.  
  38. <div id="title">Upload Videos</div>
  39. <div class="vidUpload">
  40. <form id="vidUpload">
  41. <input name="vidName" type="text" required="required" id="vidName" placeholder="Enter Video Name Here" title="Video Name">
  42. <br>
  43. <textarea name="videoDescription" id="videoDescription" required class="videoDescription" placeholder="Enter Video Description Here" title="Enter Video Description Here"></textarea>
  44.  
  45. <select name="select" required class="choosevidCat" id="choosevidCat">
  46. <option value="">Choose the Catagory for your Video Here</option>
  47. <?php
  48. $sql = ("SELECT albumId, albumName, albumSelect FROM albums");
  49. if (mysqli_connect_errno()) {
  50. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  51. }
  52.  
  53. $result = mysqli_query($mysqli, $sql);
  54.  
  55. while($row = mysqli_fetch_array($result)) {
  56. $albumid = ($row['albumId']);
  57. $album_name = ($row['albumName']);
  58. $album_name1 = ($row['albumSelect']);
  59. echo "<option value=".$album_name1. ">$album_name</option>";
  60. }
  61.  
  62. ?>
  63.  
  64.  
  65. <option id="createCat" value="createCatagory">Create New Catagory Here</option>
  66. </select>
  67.  
  68. <input type="file" name="video" id="video">
  69. <input type="submit" name="videoToUpload" id="videoToUpload" value="Upload">
  70.  
  71. </form>
  72. <div id="loader"></div>
  73. <div id="viduploadResult"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement