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
input { | |
-moz-border-radius: 4px; | |
-webkit-border-radius: 4px; | |
border-radius: 4px; | |
padding: 8px; | |
border: 0; | |
-webkit-box-shadow: inset 1px 1px 4px rgba(0,0,0,0.6); | |
-moz-box-shadow: inset 1px 1px 4px rgba(0,0,0,0.6); | |
box-shadow: inset 1px 1px 4px rgba(0,0,0,0.6); | |
} |
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 dd = $('dd'); | |
dd.filter(':nth-child(n+4)').addClass('hide'); | |
$('dt').on('click',function(){ | |
$(this) | |
.next() | |
.slideDown('fast') | |
.siblings('dd') | |
.slideUp('fast'); | |
}); |
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
setTimeout( function() { | |
jQuery('#loading_mask').hide(); | |
}, 1000 ); |
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
functions.php | |
<?php | |
function loggedIn(){ | |
//Session logged is set if the user is logged in | |
//set it on 1 if the user has successfully logged in | |
//if it wasn't set create a login form | |
if(!$_SESSION['loggd']){ | |
echo'<form action="checkLogin.php" method="post"> | |
<p> |
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 | |
$username = "your_name"; | |
$password = "your_password"; | |
$hostname = "localhost"; | |
//connection to the database | |
$dbhandle = mysql_connect($hostname, $username, $password) | |
or die("Unable to connect to MySQL"); | |
echo "Connected to MySQL<br>"; |
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 generatePassword($length=9, $strength=0) { | |
$vowels = 'aeuy'; | |
$consonants = 'bdghjmnpqrstvz'; | |
if ($strength >= 1) { | |
$consonants .= 'BDGHJLMNPQRSTVWXZ'; | |
} | |
if ($strength >= 2) { | |
$vowels .= "AEUY"; | |
} | |
if ($strength >= 4) { |
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
<? | |
// define your query | |
$your_query = "SELECT * FROM yourtable WHERE match1=\'yes\' AND match2<>\'yes\' AND ondate >=".date("Ymd").""; | |
// count the number of rows returned that match the query | |
$rowcnt = mysql_num_rows(mysql_query($your_query)); | |
// generate a random number between 0 and the number of rows found (always -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
$xml = simplexml_load_file('http://www.google.com/ig/api?weather=ADDRESS'); | |
$information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition"); | |
echo $information[0]->attributes(); |
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 dirList ($directory) { | |
// create an array to hold directory list | |
$results = array(); | |
// create a handler for the directory | |
$handler = opendir($directory); | |
// keep going until all files in directory have been read | |
while ($file = readdir($handler)) { |
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 takes 3 functions to complete the inactive session task. | |
1. We need to check if the person is actually logged in using our isLogged function | |
2. We need the function to check the time the page loaded, and when the last page was loaded | |
3. We need a function to log the user out after inactivity. | |
It is reccomended that you place the 3 functions in the same file, and have this file | |
included on EVERY page that requires a login to view the page. | |
Function sessionX() MUST come after session_start() |