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 | |
// Configuration | |
$myEmail = 'YOUR EMAIL HERE'; | |
$error = ''; | |
// To send HTML mail, the Content-type header must be set | |
$headers = 'MIME-Version: 1.0' . "\r\n"; | |
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; | |
// Additional headers |
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
$('[id*="tab-item"]').click(function(){ | |
$('iframe').each(function(index){ | |
if ( $(this)[0] !== undefined ) { | |
iframe = $(this)[0].contentWindow; | |
iframe.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*'); | |
} | |
}); | |
}); |
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
if (typeof jQuery != 'undefined') { | |
jQuery(document).ready(function ($) { | |
var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i; | |
var baseHref = ''; | |
if (jQuery('base').attr('href') != undefined) baseHref = jQuery('base').attr('href'); | |
jQuery('a').on('click', function (event) { | |
var el = jQuery(this); | |
var track = true; | |
var href = (typeof (el.attr('href')) != 'undefined') ? el.attr('href') : ""; |
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
function getRealIpAddr() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet | |
$ip=$_SERVER['HTTP_CLIENT_IP']; | |
} else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy | |
$ip=$_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip=$_SERVER['REMOTE_ADDR']; | |
} | |
return $ip; | |
} |
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
And use it with : | |
(123456789.12345).formatMoney(2, '.', ','); | |
If you're always going to use '.' and ',', you can leave them off your method call, the method will default them for you. | |
(123456789.12345).formatMoney(2); | |
If your culture has the two symbols flipped (i.e. Europeans), just paste over the following two lines in the formatMoney method: |
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 | |
/** | |
* Xử lý chuỗi | |
* @author phamquocbuu | |
* @version 1.0 | |
*/ | |
class TextMan { | |
/** | |
* Chuyển sang tiếng Việt không dấu | |
* @author phamquocbuu |
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
RewriteEngine on | |
RewriteBase /ci | |
# Hide the application and system directories by redirecting the request to index.php | |
RewriteRule ^(application|system|\.svn) index.php/$1 [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [QSA,L] |
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
$required = array('id', 'name'); | |
// Loop over field names, make sure each one exists and is not empty | |
$error = false; | |
foreach($required as $field) { | |
if (empty($_POST[$field])) { | |
$error = true; | |
} | |
} |
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 | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; | |
} |
OlderNewer