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
$grant_type = 'refresh_token'; | |
$url = 'https://oauth2.googleapis.com/token'; | |
$data = array('refresh_token' => $refresh_token, 'client_id' => $client_id, 'client_secret' => $client_secret, 'redirect_uri' => $redirect_uri, 'grant_type' => $grant_type, 'scope' => $scope ); | |
// use key 'http' even if you send the request to https://... | |
$options = array( | |
'http' => array( | |
'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
'method' => 'POST', | |
'content' => http_build_query($data) |
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
:root { | |
--myPurple: 8, 0, 24; | |
--purpleButton: 25, 0, 75; | |
--offWhite: 195, 210, 190, 1; | |
--backGrey: 40, 40, 40; | |
--linkBlue: 195, 210, 255, 1; | |
} | |
/* a is between zero and one. */ |
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 | |
//header.php | |
if(!isset($_SESSION)) | |
{ | |
ini_set('session.cookie_lifetime', 0); | |
ini_set('session.use_cookies', 1); | |
ini_set('session.use_only_cookies', 1); | |
ini_set('session.use_strict_mode', 1); | |
ini_set('session.cookie_httponly', 1); | |
ini_set('session.cookie_secure', 1); |
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
function openWindowWithPostRequest() { | |
var winName='MyWindow'; | |
var winURL='search.action'; | |
var windowoption='resizable=yes,height=600,width=800,location=0,menubar=0,scrollbars=1'; | |
var params = { 'param1' : '1','param2' :'2'}; | |
var form = document.createElement("form"); | |
form.setAttribute("method", "post"); | |
form.setAttribute("action", winURL); | |
form.setAttribute("target",winName); | |
for (var i in params) { |
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
// buffer all upcoming output | |
ob_start(); | |
echo 'All done. Goodbye.'; | |
// get the size of the output | |
$size = ob_get_length(); | |
// send headers to tell the browser to close the connection | |
header("Content-Length: $size"); | |
header('Connection: close'); |
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
<div id="formInputs"> | |
<p> | |
<input type="text" name="email" id="email" style="width:67%;" placeholder="Email*"/> | |
<input type="password" name="password" id="password" style="width:67%;" placeholder="Password*"/> | |
</p> | |
<button id="reviewButton" onclick="login()" class="buttonLogin">Log In</button> | |
</div> | |
<div id="for-logged-in-user-only" style="display:none;"></div> |
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('/var/www/html/.../header.php'); | |
$active = 'yes'; | |
$query = "SELECT * FROM calendars WHERE active = ?"; | |
$stmt = $db->prepare($query); | |
$stmt->bind_param('s', $active); | |
$stmt->execute(); | |
$result = $stmt->get_result(); | |
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
echo '<p>'; | |
function evaluate_everything($values, $expressions) { | |
$output = []; | |
foreach($expressions as $expression) { | |
$row = []; | |
foreach($values as $value){ | |
$str = ''; | |
eval("\$str = \"$expression\";"); |
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 | |
echo ' | |
<table width=50%> | |
<thead> | |
<tr> | |
<th width=60%><p>Name</p></th> | |
<th width=20%><p>Owner</p></th> | |
<th width=20%><p>Permission</p></th> | |
</tr> |
OlderNewer