Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. <?php
  2. // die("He's dead, Jim");
  3. /*
  4. UserSpice 4
  5. An Open Source PHP User Management System
  6. by the UserSpice Team at http://UserSpice.com
  7.  
  8. This program is free software: you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation, either version 3 of the License, or
  11. (at your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. require_once 'init.php';
  22. require_once $abs_us_root.$us_url_root.'users/includes/template/prep.php';
  23. //if (!securePage($_SERVER['PHP_SELF'])){die();}
  24. ?>
  25.  
  26. <?php
  27. //let's process the form
  28. if(!empty($_POST['submit'])){
  29. dump($_POST);
  30.  
  31. }
  32.  
  33. ?>
  34.  
  35. <div id="page-wrapper">
  36. <div class="container">
  37. <div class="row">
  38. <div class="col-sm-12">
  39. <form class="" action="" method="post" id="myform">
  40. <strong>Enter a url </strong><br>
  41. <input type="text" name="url" value="" id="url" required>
  42. <input type="submit" name="submit" value="Submit!" class="btn btn-primary">
  43. </form>
  44.  
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49.  
  50.  
  51. <?php require_once $abs_us_root.$us_url_root.'usersc/templates/'.$settings->template.'/container_close.php'; //custom template container ?>
  52.  
  53. <!-- footers -->
  54. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  55. <script type="text/javascript">
  56. $( document ).ready(function() {
  57. $('#myform').submit(function (e) {
  58. var url = $("#url").val(); //get the url from the input by the id url
  59. console.log(url);
  60. var lowercase = url.toLowerCase(); //temporarily convert to lowercase to avoid issues
  61. if(lowercase.startsWith('https://www.youtube.com/watch?v=') == false && lowercase.startsWith('https://m.youtube.com/watch?v=') == false) {
  62. e.preventDefault();
  63. alert("Invalid youtube url. Must be https://www.youtube.com/watch?v=xxxxxxx.");
  64. }
  65. })
  66.  
  67. });
  68. </script>
  69.  
  70.  
  71. <?php require_once $abs_us_root.$us_url_root.'usersc/templates/'.$settings->template.'/footer.php'; //custom template footer?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement