This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.css" rel="stylesheet"> | |
| <div class="summernote"></div> | |
| <textarea name="summerNoteContent" id="resultSummerNote" required=""></textarea> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.js"></script> | |
| <script | |
| src="https://code.jquery.com/jquery-2.2.4.min.js" | |
| integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" | |
| crossorigin="anonymous"></script> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $file=''; | |
| if(isset($_FILES['img']) AND $_FILES["img"]['size']<=10000000 AND $_FILES["img"]['size']>100){ | |
| $folder = '../images/blog/'; | |
| $tmp_name = $_FILES["img"]["tmp_name"]; | |
| $name = $_FILES["img"]["name"]; | |
| $img = pathinfo($_FILES["img"]['name']); | |
| $file = "blog_".rand(0,999999).$name; | |
| move_uploaded_file($tmp_name, $folder.$file); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $valid_formats = array("jpg", "png", "gif", "bmp"); | |
| $max_file_size = 1024*7500; //100 kb | |
| $path = "assets/img/photo/"; // Upload directory | |
| $count = 0; | |
| if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){ | |
| foreach ($_FILES['files']['name'] as $f => $name) { | |
| if ($_FILES['files']['error'][$f] == 4) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Ensures an ip address is both a valid IP and does not fall within | |
| * a private network range. | |
| */ | |
| function validate_ip($ip) | |
| { | |
| if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function myJQueryCode() { | |
| //Do stuff with jQuery | |
| } | |
| if(typeof jQuery=='undefined') { | |
| var headTag = document.getElementsByTagName("head")[0]; | |
| var jqTag = document.createElement('script'); | |
| jqTag.type = 'text/javascript'; | |
| jqTag.src = 'jquery.js'; | |
| jqTag.onload = myJQueryCode; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if(isset($_REQUEST['src'])){ | |
| $file_name = $_REQUEST['src']; | |
| header('Content-Type: application/octet-stream'); | |
| header("Content-Transfer-Encoding: Binary"); | |
| header("Content-disposition: attachment; filename=\"".$file_name."\""); | |
| readfile('../Your_Path_Here/'.$file_name); | |
| exit; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Using the core $.ajax() method | |
| $.ajax({ | |
| // The URL for the request | |
| url: "post.php", | |
| // The data to send (will be converted to a query string) | |
| data: { | |
| id: 123 | |
| }, | |
| // Whether this is a POST or GET request | |
| type: "GET", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if(strpos($_SERVER['REQUEST_URI'],"home")){ // For example blabla.com/home | |
| // Do something | |
| }?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .top-box | |
| { | |
| box-shadow: inset 0 7px 9px -7px rgba(0,0,0,0.4); | |
| } | |
| .left-box | |
| { | |
| box-shadow: inset 7px 0 9px -7px rgba(0,0,0,0.4); | |
| } | |
| .right-box | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| ## Count to 50 | |
| 1.upto(50) {|n| puts n} | |
| ## Count Down to 1 | |
| 50.downto(1) {|n| puts n} | |
| ## Count to 20 | |
| (1..20).each {|n| puts n} |
OlderNewer