Return to Boyar.net homepage
PHP Time/Date Connection tips with session and https checker:
PHP:
ini_set('display_errors', '1');
error_reporting(E_ALL);
// Change the line below to your timezone!
date_default_timezone_set('America/Denver');
$zdate = date('Y/m/d h:i:s a', time());
strtolower
https://www.php.net/manual/en/function.date.php
$date = date('m/d/Y h:i:s a', time());
echo $date;
if (session_status() == 1) {
session_start();
// _DISABLED = 0
// _NONE = 1
// _ACTIVE = 2
$serv="no";
if (isset($_SERVER['HTTPS'])) {
if ($_SERVER['HTTPS'] == 1) {
$serv="yes";
} elseif (strtolower($_SERVER['HTTPS']) == 'on') {
$serv="yes";
}
} elseif ($_SERVER['SERVER_PORT'] == HTTPS_PORT) {
$serv="yes";
}
if (session_status() == 1) {
session_start();
Font Code SAMPLE:
<style>
@font-face {
font-family: "CherryCreamSoda";
src: url("fonts/CherryCreamSoda.eot"); /* IE9 Compat Modes */
src: url("fonts/CherryCreamSoda.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("fonts/CherryCreamSoda.otf") format("opentype"), /* Open Type Font */
url("fonts/CherryCreamSoda.svg") format("svg"), /* Legacy iOS */
url("fonts/CherryCreamSoda.ttf") format("truetype"), /* Safari, Android, iOS */
url("fonts/CherryCreamSoda.woff") format("woff"), /* Modern Browsers */
url("fonts/CherryCreamSoda.woff2") format("woff2"); /* Modern Browsers */
font-weight: normal;
font-style: normal;
}
</style>
<html>
<head>
<title>You converted a font!</title>
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
<style>
.thankyou, .notes {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
}
.sample {
font-family: 'CherryCreamSoda';
font-size: 24px;
border: 1px solid #ddd;
display: inline-block;
padding: 10px;
}
</style>
</head>
<body>
<p class="thankyou">
Thank you for using <a href="http://www.font-converter.net">font-converter.net</a>!<br />
We really appreciate you for using our little service. We hope we can help you with our services again soon.
<br /><br />
And there it is, your lovely converted web font:
</p>
<p class="sample">
The quick brown fox jumps over the lazy dog
</p>
<p class="notes">
<b>CSS Stylesheet:</b> You'll find the stylesheet in this folder (if selected). The file is called <code>style.css</code><br />
<b>web fonts:</b> You'll find all converted fonts in a subdirectory called <code>fonts</code> in this folger<br />
</p>
</body>
</html>
Font Code SAMPLE 2:
For some reason the font-face above does not always work...
@font-face {
font-family: 'Conv_SquareBT';
src: url('fonts/SquareBT.eot');
src: local('?'), url('fonts/SquareBT.woff') format('woff'), url('fonts/SquareBT.ttf') format('truetype'), url('fonts/SquareBT.svg') format('svg');
font-weight: normal;
font-style: normal;
}
html *
{
font-size: 18px;
color: #000;
font-family: Conv_SquareBT;
}
Other Stuff:
Firefox (ONLINE ONLY WTF???!!) doesn't like font face Arial or Arial Black
fix use this: style="font-family:'Arial Black', Arial; font-weight: 900;"
Big NOTE!: Firefox doesn't allow some scripts or files to access different folders if not online
Sept 1, 2019 ::: As of middle 2019 it never had this restriction (this is not good)(blame windows)
onclick="document.getElementById('mylink').submit()"
Warning about TrackBacks from Google and other API's:
A warning about trackbacks from google (or other) APIS using online fonts
or Online Jquery links etc.
BEST PRACTISE: upload and link a local version to your own site... Don't rely on other sites to manage your base Code, your fonts, or anything else for that matter (if possible).
hackers can watch online code query versions of traffic, whether the big companies like it or not.
Even if the code is encrypted they can detect it bouncing off the code baring site...
So; a hacker bot sees you using a google font api and immediately goes to your site; looks for your forms/comment form (data stuff) etc. The bot starts spamming your comment forms (etc)
searching for weaknesses, which includes the newest or even older versions of php and javascript code... Instant.
(this would include local health care web sites etc)
PHP variable nesting notes:
$arr["BSCS001"] = 3.27;
$arr["BSCS002"] = 2.80;
$arr["BSCS003"] = 3.40;
$arr["BSCS004"] = 4.00;
$arr["BSCS005"] = 2.74;
foreach($arr as $key => $val){
echo $key. " has earned ". $val. " CGPA";
echo "
";
}//foreach
------
$arr = array("BSCS001" => 3.27,
"BSCS002" => 2.80,
"BSCS003" => 3.40,
"BSCS004" => 4.00,
"BSCS005" => 2.74);
foreach($arr as $key => $val){
echo $key. " has earned ". $val. " CGPA";
echo "
";
}//foreach
------
$arr["str1"] = 1;
$arr[0] = "abc";
$arr[1] = 2;
$arr["str2"] = "def";
foreach ($arr as $key => $val){
echo $key." has ".$val."
";
}
------
$arr[0] = 10;
$arr[1] = 20;
$arr[2] = 30;
$arr[3] = 40;
$arr[4] = 50;
for($i =0; $i<5; $i++)
echo $arr[$i]."
";
------
$responseArray = explode("&", $resp);
foreach($responseArray as $key => $value)
{
list($a, $b) = explode("=", $value);
$respArray[$a] = $b;
//echo $respArray[$a].":
";
}
http://www.tutorialspanel.com/an-introduction-to-arrays-in-php/
PHP Error Set:
ini_set('display_errors', '1');
error_reporting(E_ALL & ~E_NOTICE);
https://www.bestcssbuttongenerator.com/