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 valid($setting, $string) { | |
if($setting == "email") { | |
if(preg_match("/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/", $string)) { | |
return true; | |
} else { | |
return false; | |
} | |
} elseif($setting == "website") { | |
if(preg_match("/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/", $string)) { | |
return 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
body { | |
background: #fff url(images/bg.png) repeat-x top center; | |
font: normal 12px Georgia; | |
color: #000; | |
margin: 0px auto; | |
} | |
a:link, a:visited { color: #000; } | |
a:hover, a:visited:hover { text-decoration:none; } | |
p { clear: both; } | |
h1 { |
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
$sql = fopen("installation.sql", "r"); | |
$new_sql = str_replace("{PREFIX}", $_POST['prefix'], $sql); | |
$new_sql = str_replace("{USERNAME}", $post['username'], $sql); | |
$new_sql = str_replace("{PASSWORD}", $post['password'], $sql); | |
$new_sql = str_replace("{EMAIL}", $post['email'], $sql); | |
$new_sql = str_replace("{IPADDR}", $post['ipaddr'], $sql); | |
$new_sql = str_replace("{BLOGTITLE}", $post['title'], $sql); | |
$new_sql = str_replace("{BLOGKEYWORDS}", $post['keywords'], $sql); | |
$new_sql = str_replace("{BLOGDESCRIPTION}", $post['description'], $sql); |
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 | |
function upload($file) { | |
$allowed = array("image/png", "image/jpg", "image/jpeg", "image/gif"); | |
$type = $file['type']; | |
$extension = end(explode("/", $type)); | |
$destination = sha1(time().rand().md5($file['name'])).".".$extension; | |
$directory = "./uploads/"; | |
$limit = 1024000; | |
$success = "Your photo has been uploaded!"; |
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 | |
/* FrostBB - Open source bulletin board. | |
http://www.frostbb.net/ | |
License: http://www.frostbb.net/about:license | |
File: /resources/class_core.php | |
Author: Sam Jesso (www.xiofire.com) | |
Handles the core class and functions of FrostBB. */ |
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 variables, edit accordingly */ | |
$username = "cloudica"; | |
$domain = "cloudi.ca"; //Alternative is cloudica.net | |
$max_posts = "10"; //Leave empty for all available posts. | |
/* Fetch the posts and loop. */ | |
$xml = simplexml_load_file("http://".$domain."/feeds/".$username.".rss"); | |
if(!empty($max_posts)) |
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 | |
define("OBJECT", "object"); | |
define("ASSOC", "assoc"); | |
define("ARRAY", "array"); | |
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 | |
//Get the library. | |
require "mysql.php"; | |
//New connection. | |
$db = new MySQL("localhost", "username", "password", "database"); | |
if($db->errno()) | |
{ | |
print($db->error()); | |
exit; |
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 | |
function secure_wysiwyg($filter) | |
{ | |
$badattr = array('onclick="' => 'void="', | |
'onmouseover="' => 'void="', | |
'onload="' => 'void="', | |
'onblur="' => 'void="', | |
'onfocus="' => 'void="', | |
'class="' => 'void="', | |
'id="' => 'void="', |
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 | |
/* ! | |
* PHP typeof() function - Similar to the JavaScript method. | |
* Usage: if(typeof($phpQuery) == "undefined") require_once "phpQuery.php"; | |
* if(typeof($_GET) == "array") echo "There are \$_GET arguments present."; | |
* etc... | |
* Author: Sam Jesso | |
* URI: http://sammm.net/ | |
* Date: Sun, 9 Oct, 2010 | |
* */ |
OlderNewer