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
/* | |
<ul class='tabs'> | |
<li><a href='#tab1'>most viewed</a></li> | |
<li><a href='#tab2'>recent</a></li> | |
<li><a href='#tab3'>most commented</a></li> | |
</ul> | |
<div id='tab1'> | |
content 1111 | |
</div> | |
<div id='tab2'> |
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
// thin wrapper around local-storage to avoid | |
// errors if the browser does not support it. | |
var globalVar.localStorage = { | |
set: function(key, value) { | |
if (!swarm.localStorage.canStore()) { | |
return null; | |
} | |
return window.localStorage.setItem(key, value); | |
}, |
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 | |
try { | |
$pdo = new PDO( | |
'mysql:host=localhost;dbname=test_database', | |
'username', | |
'password', | |
array( | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | |
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' |
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
# Necessary to prevent problems when using a controller named "index" and having a root index.php | |
# more here: http://httpd.apache.org/docs/2.2/content-negotiation.html | |
Options -MultiViews | |
# Activates URL rewriting (like myproject.com/controller/action/1/2/3) | |
RewriteEngine On | |
# Prevent people from looking directly into folders | |
Options -Indexes |
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 | |
//session_start(); | |
header('Cache-control: private'); // IE 6 FIX | |
function showUrl($lang){ | |
$url = basename($_SERVER['REQUEST_URI']); | |
if(isset($_GET['page'])){ | |
$url = "?page=".$_GET['page']; | |
$url .="&lang=".$lang; |
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 isNumeric(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
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 | |
if(isset($_GET['uid']) && isset($_GET['mid'])){ | |
$mailid = (int)$_GET['mid']; | |
$userid = (int)$_GET['uid']; | |
$db = new mysqli_connect('databaseserver', 'databaseuser', 'databasepassword', 'databasename'); | |
$db->query("INSERT INTO mailreaders (mailid, userid) VALUES ($mailid, $userid)"); | |
$im=imagecreatetruecolor(1,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
$('#e_form').each(function() { | |
this.reset(); //Here form fields will be cleared. | |
}); |
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 | |
/* CONFIG */ | |
define("DB_HOST", "localhost"); | |
define("DB_USER", "root"); | |
define("DB_PASS", ""); | |
define("DB_DATABASE", "my_db"); | |
/* CONNECTION */ |
OlderNewer