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
| // https://stackoverflow.com/questions/6287903/how-to-properly-add-csrf-token-using-php/31683058#31683058 | |
| // Generating a CSRF Token (PHP 7) | |
| $_SESSION['token'] = bin2hex(random_bytes(32)); | |
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
| What is Cross Site Scripting or XSS? | |
| It simply means: executing abritrary JavaScript code on the page. | |
| Ref: https://css-tricks.com/what-is-xss/ |
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
| Tag: | |
| * SQL Injection | |
| * XSS - Cross-Site Script Injection | |
| * CSRF - Cross-Site Request Forgery | |
| * Cross-Origin Resource Sharing (CORS) | |
| * JSON with Padding (JSONP) | |
| * The Same-Origin Policy (XHR) XMLHttpRequest | |
| Ref: http://clarkfeusier.com/2015/09/07/browser-security-xss-csrf-injection-safety.html |
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
| <!-- | |
| How to detect if JavaScript is disabled? | |
| https://stackoverflow.com/questions/121203/how-to-detect-if-javascript-is-disabled/15027965#15027965 | |
| (Umesh Patil) | |
| --> | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <noscript> | |
| <meta http-equiv="refresh" content="0; /?javascript=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
| <?php | |
| // example: https://localhost/parse_str-example.php?a=123&b=ABC&c=123abc | |
| $queryString = $_SERVER['QUERY_STRING']; | |
| $queryArray = []; | |
| parse_str($queryString, $queryArray); | |
| echo '<pre>'; | |
| print_r($queryString); | |
| echo '<pre>'; |
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
| <!doctype html> | |
| <!-- | |
| by: erlangparasu 2017-03-23 | |
| --> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Home</title> | |
| <link rel="stylesheet" type="text/css" href="style-0.css"> |
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
| ; KeypressOSD.ahk | |
| ;-------------------------------------------------------------------------------------------------------------------------- | |
| ; ChangeLog : v2.22 (2017-02-25) - Now pressing same combination keys continuously more than 2 times, | |
| ; for example press Ctrl+V 3 times, will displayed as "Ctrl + v (3)" | |
| ; v2.21 (2017-02-24) - Fixed LWin/RWin not poping up start menu | |
| ; v2.20 (2017-02-24) - Added displaying continuous-pressed combination keys. | |
| ; e.g.: With CTRL key held down, pressing K and U continuously will shown as "Ctrl + k, u" | |
| ; v2.10 (2017-01-22) - Added ShowStickyModKeyCount option | |
| ; v2.09 (2017-01-22) - Added ShowModifierKeyCount option | |
| ; v2.08 (2017-01-19) - Fixed a bug |
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
| var foto1 = $('#input_image_1')[0].files[0]; | |
| var foto2 = $('#input_image_2')[0].files[0]; | |
| var foto3 = $('#input_image_3')[0].files[0]; | |
| var foto4 = $('#input_image_4')[0].files[0]; | |
| console.log('foto1: ' + foto1); | |
| console.log('foto2: ' + foto2); | |
| console.log('foto3: ' + foto3); | |
| console.log('foto4: ' + foto4); | |
| var formData = new FormData(); | |
| formData.append('id_token', mIdToken); |
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
| // Get Last Day Of Month | |
| // Using the modify function it allows you to easily get the last day of the month by simply by writing the words in plain English. | |
| // Ref: https://paulund.co.uk/datetime-php | |
| $date = new DateTime('now'); | |
| $date->modify('last day of this month'); | |
| echo $date->format('Y-m-d'); |
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
| // ... | |
| // date time picker must follow modal scroll | |
| $('.ui.dimmer.modals.active').scroll(function () { | |
| var newTop = $('#div_waktu').offset().top + $('#div_waktu').height(); | |
| //console.log('top:' + $('#div_waktu').offset().top); | |
| //console.log('height:' + $('#div_waktu').height()); | |
| //console.log('newTop:' + newTop); | |
| $('#ui-datepicker-div').css('top', newTop + 'px'); | |
| }); |