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
// Post to Page Function | |
function postToPage(url,data) { | |
// Setup Form Object | |
var f = document.createElement("form"); | |
f.setAttribute('method',"post"); |
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
// SEO Friendly Filter Function | |
function seoUrl($string) { | |
$string = trim($string); // Trim String | |
$string = strtolower($string); //Unwanted: {UPPERCASE} ; / ? : @ & = + $ , . ! ~ * ' ( ) | |
$string = preg_replace("/[^a-z0-9_\s-]/", "", $string); //Strip any unwanted characters |
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
# Access Mac Virtual Hosts | |
vi /private/etc/apache2/extra/httpd-vhosts.conf | |
# Creating a New Virtual Host | |
Directory "/Users/andrew/Documents/ASCMS/"> | |
Allow From All | |
AllowOverride All | |
</Directory> | |
<VirtualHost *:80> | |
DocumentRoot "/Users/andrew/Documents/ASCMS/" |
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 isNumber(n) { | |
// Determine if numeric (whole number or float) | |
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
UPDATE `categories` SET url = REPLACE(url,"fromstring","tostring") |
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 encrypt($key,$string) { | |
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)))); | |
} | |
function decrypt($key,$encrypted) { | |
return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); | |
} |
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 dbSelect($select,$from,$where,$orderby=false,$limit=false,$connection=false) { | |
// dbSelect 0.2, Created by AS | |
// General Database Selection Function | |
// initate variables | |
$query = ''; // String to Setup query | |
$return = ''; // The return array | |
$rowsReturned = ''; // The Number of Rows Returned from the query | |
$error = false; // Boolean. Has an error. | |
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
// Loop Directory Function | |
function loopDirectory($path,$filetypes='',$stringmatch='') { | |
// initiate the variables | |
$array = array(); | |
$error = ''; | |
// check if $filetypes is set, if so and not an array make an array | |
if((!empty($filetypes)) && (!is_array($filetypes))) { | |
$filetypes = array($filetypes); | |
} |
NewerOlder