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> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<h1></h1> | |
</body> |
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
/* | |
* 判斷按下的按鈕是哪一個 | |
* @param (event) e keypress event. | |
* @param (mix) targetKeyChar 按鍵的編號或名稱,如果是這個按鍵,就執行 callback | |
* @param (function) callBack 送入callback的function,不用加()括號 | |
* | |
*/ | |
var detectKeyPress = function(e, targetKeyChar, callBack){ | |
var keynum |
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
$mysqli = new mysqli('localhost', 'root', 'root', 'register'); | |
if ($mysqli->connect_error) { | |
die('Connect Error ('.$mysqli->connect_errno.')'.$mysqli->connect_error); | |
}else{ | |
//printf ( 'Connect succeeded: %s', $mysqli->host_info ); | |
} |
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
ini_set('display_errors',1); | |
ini_set('display_startup_errors',1); | |
error_reporting(-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
// http://subhra.me/codeigniter-pagination-url-get-parameters/ | |
if (count($_GET) > 0) $config['suffix'] = '?' . http_build_query($_GET, '', "&"); | |
$config['first_url'] = $config['base_url'].'?'.http_build_query($_GET); |
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
// Run this SQL statement (in the mysql client, phpMyAdmin, or wherever) to retrieve all the MyISAM tables in your database. | |
// Replace value of the name_of_your_db variable with your database name. | |
// Then, copy the output and run as a new SQL query. | |
SET @DATABASE_NAME = 'name_of_your_db'; | |
SELECT CONCAT('ALTER TABLE `', table_name, '` ENGINE=InnoDB;') AS sql_statements | |
FROM information_schema.tables AS tb | |
WHERE table_schema = @DATABASE_NAME | |
AND `ENGINE` = 'MyISAM' |
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
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; | |
$actual_page = $_SERVER[REQUEST_URI]; |
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> | |
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> | |
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> |
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
var youtube_video = $('iframe'); | |
var url = youtube_video.attr('src'); // 1. First get the iframe URL | |
youtube_video.attr('src', ''); // 2. Then assign the src to null, this then stops the video been playing | |
youtube_video.attr('src', url); // If you need to reassign the URL back to your iframe, so when you hide and load it again you still have the link |
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
.center-items { overflow: auto; list-style-type: none; text-align: center; } | |
.center-items .item { display: inline-block; vertical-align: top; } | |
<div class="center-items"> | |
<div class="item">1</div> | |
<div class="item">2</div> | |
<div class="item">3</div> | |
</div> |
OlderNewer