Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // die("He's dead, Jim");
- /*
- UserSpice 4
- An Open Source PHP User Management System
- by the UserSpice Team at http://UserSpice.com
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- require_once 'init.php';
- require_once $abs_us_root.$us_url_root.'users/includes/template/prep.php';
- //if (!securePage($_SERVER['PHP_SELF'])){die();}
- ?>
- <?php
- //let's process the form
- if(!empty($_POST['submit'])){
- dump($_POST);
- }
- ?>
- <div id="page-wrapper">
- <div class="container">
- <div class="row">
- <div class="col-sm-12">
- <form class="" action="" method="post" id="myform">
- <strong>Enter a url </strong><br>
- <input type="text" name="url" value="" id="url" required>
- <input type="submit" name="submit" value="Submit!" class="btn btn-primary">
- </form>
- </div>
- </div>
- </div>
- </div>
- <?php require_once $abs_us_root.$us_url_root.'usersc/templates/'.$settings->template.'/container_close.php'; //custom template container ?>
- <!-- footers -->
- <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
- <script type="text/javascript">
- $( document ).ready(function() {
- $('#myform').submit(function (e) {
- var url = $("#url").val(); //get the url from the input by the id url
- console.log(url);
- var lowercase = url.toLowerCase(); //temporarily convert to lowercase to avoid issues
- if(lowercase.startsWith('https://www.youtube.com/watch?v=') == false && lowercase.startsWith('https://m.youtube.com/watch?v=') == false) {
- e.preventDefault();
- alert("Invalid youtube url. Must be https://www.youtube.com/watch?v=xxxxxxx.");
- }
- })
- });
- </script>
- <?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