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 | |
$countries = array | |
( | |
'AF' => 'ps-AR', | |
'AX' => 'Aland Islands', | |
'AL' => 'sq-AL', | |
'DZ' => 'ar-DZ', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', |
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
// include the library code: | |
#include <LiquidCrystal.h> // use the library for Display | |
#include <IRremote.h> // use the library for IR | |
const int receiver = 10; // pin of IR receiver to Arduino | |
const int bulb = 9; // To bulb or whatever you connect. | |
// initialize the library with the numbers of the interface pins | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
int fadeValue; |
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
/*Code By SHAHID | |
Turn On LED via Web through ESP8266 with Arduino. | |
ESP8266 & ARDUINO HTML WEB SERVER. | |
*/ | |
#include <SoftwareSerial.h> | |
#define DEBUG true | |
SoftwareSerial esp8266(2,3); // make RX Arduino line is pin 5, make TX Arduino line is pin 6. | |
int LED=12; //LED PIN | |
int itsONled[] = {0,0}; // LED STATUS ARRAY eg- ON or OFF at startup. each value represent ech led. |
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 | |
$cookie_name = "language"; //Cookie Name | |
$default_language = "en-us"; //Set here the default language code | |
$available_langs = array('en-us','bn'); //The Language we support list | |
//This will activate when language request submitted by users. | |
if(isset($_POST['lang'])){ | |
// check if the language is available in array | |
if(in_array($_POST['lang'], $available_langs)) | |
{ |
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
<html> | |
<head> | |
<title>Host Two Template</title> | |
<link rel="stylesheet" type="text/css" title="light" href="light.css"> | |
<link rel="alternate stylesheet" type="text/css" title="dark" href="dark.css"> | |
</head> | |
<body> | |
<div><h1>Content</h1></div> | |
<div> | |
<a href="#" onclick="switch_style('light');return false;" name="theme" value="light Theme" id="light">Light</a> |
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
// put url by replacing http://example.com | |
//HTML Code | |
//<a href="javascript:void" onclick="loadUrl('http://example.com')">url</a> | |
<script type="text/javascript"> | |
function loadUrl(newLocation) | |
{ | |
var win = window.open(newLocation, '4536453645', 'width=500,height=200,left=375,top=330'); //adjust height weidth of window | |
setTimeout(function(){win.close()}, 5000);//5000 defines time 5000 = 5 sec | |
return false; |
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 | |
// This code find specific value or words in arrary | |
$array = array('unacceptword', 'unacceptword1', 'unacceptword2'); | |
$array1 = array('noteligible1', 'noteligible2', 'noteligible3'); | |
//here you can post your value by form method | '$_POST[username]' | |
$obtainvalue = 'noteligible1' ;//'$_POST[username]'; | |
if (in_array($obtainvalue, $array) || in_array($obtainvalue, $array1)){echo 'Not Acceptable';} | |
else if (in_array($obtainvalue, $array) || in_array($obtainvalue, $array1)){echo 'Not Eligible';} | |
?> | |
<!-- Your Form 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
<?php | |
// with prefix | |
$uniqueid = uniqid('prefixhere_'); | |
echo $uniqueid; | |
/* prints | |
prefixhere_594f60936a7e9 | |
*/ | |
// with more entropy | |
$uniqueid_2 = uniqid('',true); |
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
<!-- This display the countdown timer clock in an element --> | |
<p id="timer"></p> | |
<script> | |
//Put here the time and date when it will stop ("Sep 17, 2020 15:37:25") | |
var countdowndate = new Date("Sep 17, 2020 15:37:25").getTime(); | |
var x = setInterval(function() { | |
var now = new Date().getTime(); | |
var timecal = countdowndate - now; | |
var days = Math.floor(timecal/(1000*60*60*24)); |