This file contains 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
body | |
{ | |
font-family: 'Segoe UI', Verdana, Arial, Helvetica, sans-serif; | |
background-color: whitesmoke; | |
line-height: 26px; | |
} | |
.container | |
{ | |
background: white; | |
border: 1px solid silver; |
This file contains 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
let http = new XMLHttpRequest(); | |
http.open( 'GET', 'get.php' ); | |
http.send(); | |
http.onreadystatechange = function() | |
{ | |
if ( http.readyState == 4 && http.status == 200 ) | |
{ | |
console.log( http.responseText ); | |
} | |
} |
This file contains 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
let data1 = 'Hello World!'; | |
let data2 = 'Hello Universe!'; | |
let http = new XMLHttpRequest(); | |
http.open( 'POST', 'post.php' ); | |
http.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); | |
http.send( 'data1=' + data1 + '&data2=' + data2 ); | |
http.onreadystatechange = function() | |
{ | |
if ( http.readyState == 4 && http.status == 200 ) | |
{ |
This file contains 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
// Add target="_blank" to all anchor tags, v 1.05 | |
for ( x of document.querySelectorAll( 'a' ) ) x.setAttribute( 'target', '_blank' ); |
This file contains 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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Form Input Test: Variable Value in Radio Input, Proof of Concept (Success)</title> | |
</head> | |
<body> | |
<?php | |
This file contains 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 | |
require_once 'db_info.inc'; | |
$db = new mysqli( $servername, $username, $password ); | |
if ( $db->connect_error ) | |
{ | |
die( 'Connection Error: ' . $db->connect_error ); | |
} |
This file contains 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 | |
// For MySQL | |
// Escape $_GET elements | |
foreach ( $_GET as $key => $value ) | |
{ | |
$_GET[ $key ] = $db->escape_string( $_GET[ $key ] ); | |
} | |
// Escape $_POST elements |
This file contains 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
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] |
This file contains 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 | |
$to = '[email protected]'; | |
$subject = 'Test mail'; | |
$message = 'Hello! This is a simple email message.'; | |
$from = '[email protected]'; | |
$headers = 'From: ' . $from; | |
mail( $to, $subject, $message, $headers ); | |
echo 'Mail Sent.'; |
This file contains 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
if ( typeof( Storage ) !== 'undefined' ) | |
{ | |
console.log( 'Storage Exists!' ); | |
} | |
else | |
{ | |
console.log( 'Storage doesn\'t Exists!' ); | |
} |
OlderNewer