Results 11 to 20 of 22
-
25th Nov 2009, 02:58 PM #11OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comsee now im just confused ?
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
25th Nov 2009, 03:02 PM #12MemberWebsite's:
warezxtc.com
-
25th Nov 2009, 03:04 PM #13Respected DeveloperWebsite's:
wrzc.orgDownloaded and will look through it more later. Looks really good litewarez. Will probably be back later with questions.
Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
25th Nov 2009, 03:07 PM #14OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comyea Mr Happy... try create your own libary class like a DB for instance..
include it in the boot.php like the HttpInput file then add it to the Registry like
$Regsitry->Database = new libary_mysql("localhost","root","","myDb");
heres one of my little db classes you can play with
PHP Code:<?php
class libary_mysql{
private $mysql_resource,$database_resource;
public $connected = false;
public $selected = false;
public $activate_database_name;
//Resource
public $last_query_resource = false;
function connect($host,$user,$pass,$database = false){
//Connect
$this->mysql_resource = mysql_connect($host,$user,$pass);
if($this->mysql_resource){
$this->connected = true;
if($database !== false){
$this->database_resource = mysql_select_db($database,$this->mysql_resource);
if($this->database_resource){
$this->activate_database_name = $database;
$this->selected = true;
}
}
}
}
public function select_db($database){
if($this->connected){
$this->database_resource = mysql_select_db($database,$this->mysql_resource);
if($this->database_resource){
$this->selected = true;
$this->activate_database_name = $database;
return true;
}
$this->selected = false;
return false;
}
}
//Lets get into some usable functions
public function isConnected(){
return $this->connected;
}
public function isSelected(){
return $this->selected;
}
public function getDbConnection(){
if($this->isConnected()){
return $this->mysql_reasource;
}
return false;
}
public function success(){
return $this->last_query_resource ? true : false;
}
public function errno(){
if($this->isConnected()){
return mysql_errno($this->mysql_resource);
}
return false;
}
public function error(){
if($this->isConnected()){
return mysql_error($this->mysql_resource);
}
return false;
}
public function list_tables(){
if($this->isConnected()){
return mysql_list_tables($this->activate_database_name,$this->mysql_resource);
}
return false;
}
public function list_processes(){
if($this->isConnected()){
return mysql_list_processes($this->mysql_resource);
}
return false;
}
public function list_fields($table){
if($this->isConnected()){
return mysql_list_fields($this->active_database_name,$table,$this->mysql_resource);
}
return false;
}
public function list_dbs(){
if($this->isConnected()){
mysql_list_dbs($this->mysql_resource);
}
return false;
}
public function affected_rows(){
if($this->isConnected()){
return mysql_affected_rows($this->mysql_resource);
}
return false;
}
public function num_rows(){
if($this->isConnected()){
return mysql_num_rows($this->last_query_resource);
}
return false;
}
public function fetch_assoc(){
if($this->isConnected() && $this->last_query_resource){
return mysql_fetch_assoc($this->last_query_resource);
}
return false;
}
public function fetch_array(){
if($this->isConnected() && $this->last_query_resource){
return mysql_fetch_array($this->last_query_resource);
}
return false;
}
//Query Function
public function query($query){
if($this->isConnected()){
$this->last_query_resource = mysql_query($query,$this->mysql_resource) or trigger_error(sprintf("DB Error! {%s}",$this->error()));
}
return $this; /*Return this instance here so after the query has been called you can firectly use another method after*/
}
public function fetch_all_assoc(){
if($this->isConnected() && $this->last_query_resource){
$tmp = array();
while($row = $this->fetch_assoc()){
$tmp[] = $row;
}
return $tmp;
}
return false;
}
public function fetch_all_array(){
if($this->isConnected() && $this->last_query_resource){
$tmp = array();
while($row = $this->fetch_array()){
$tmp[] = $row;
}
return $tmp;
}
return false;
}
}
?>
and use like
PHP Code:$downloads = $Regsitry->database->query("SELECT * FROM downloads LIMIT 100")-> fetch_all_assoc();
/*
** then you have 100 downloads in $downloads.. simples
*/
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
25th Nov 2009, 03:13 PM #15MemberWebsite's:
warezxtc.comGod bless you litewarez
-
25th Nov 2009, 03:16 PM #16Member
looks good..but its out of my scope
Coding Horror Fan
I don't read PM's frequently .
-
25th Nov 2009, 03:17 PM #17OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comLmao Cyber.... while im here heres another libary i use.. just over write the current HttpInput class with this one
PHP Code:<?php
if(!defined("ROOT")){die("Out of scope");}
class input{
private $input_data = array();
function __construct(){
$this->unregister_globals();
//Clean inputted data
$this->input_data['get'] = $this->clean_input($_GET);
$this->input_data['post'] = $this->clean_input($_POST);
$this->input_data['cookie'] = $this->clean_input($_COOKIE);
}
public function get($key){
if(isset($this->input_data['get'][$key])){return $this->input_data['get'][$key];}
return false;
}
public function post($key){
if(isset($this->input_data['post'][$key])){return $this->input_data['post'][$key];}
return false;
}
public function cookie($key){
if(isset($this->input_data['cookie'][$key])){return $this->input_data['cookie'][$key];}
return false;
}
public function find($key){
if(isset($this->input_data['get'][$key])){return $this->input_data['get'][$key];}
if(isset($this->input_data['post'][$key])){return $this->input_data['post'][$key];}
if(isset($this->input_data['cooie'][$key])){return $this->input_data['cookie'][$key];}
return false;
}
private function unregister_globals(){
$input_elements = array(
$_GET,$_POST,$_COOKIE,$_SERVER,$_FILES,$_ENV,
(isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array());
$protected = array(
'_SERVER','_GET','_POST',
'_FILES','_REQUEST','_SESSION',
'_ENV','GLOBALS','HTTP_RAW_POST_DATA'
/*Extras will be added if globals are used by the system*/
);
//Loop and remove un-protected
foreach($input_elements as $global){
if(!is_array($global) && !in_array($global, $protected)){
unset($GLOBALS[$global]);
}else{
foreach($global as $key => $val){
if(!in_array($key, $protected)){
unset($GLOBALS[$key]);
}
if(is_array($val)){
foreach($val as $k => $v){
if(!in_array($k, $protected)){
unset($GLOBALS[$k]);
}
}
}
}
}
}
}
private function clean_input($inbound,$key = false){
//Check if were checking keys
if($key === true){
if (!preg_match("/^[a-z0-9:_\/-]+$/i", $inbound)){
exit('Disallowed Key Characters.');
}
return $inbound;
}
//Do values
if(is_array($inbound)){
$tmp = array();
foreach ($inbound as $key => $val){
$tmp[$this->clean_input($key,true)] = $this->clean_input($val);
}
return $tmp;
}
if(get_magic_quotes_gpc()){
$inbound = stripslashes($inbound);
}
// Standardize newlines
if (strpos($inbound, "\r") !== FALSE){
$inbound = str_replace(array("\r\n", "\r"), "\n", $inbound);
}
return $inbound;
}
}
?>
$titles = $Regsitry->HttpInput->post("titles");
$urls = $Regsitry->HttpInput->post("urls");
$types = $Regsitry->HttpInput->post("types");
//Simples
this is practically a working system now lmaoJoin Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
25th Nov 2009, 03:24 PM #18MemberWebsite's:
warezxtc.comJesus, how many times do you want me to bless you?
-
25th Nov 2009, 03:41 PM #19OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comehhh thought i might aswell share em lol
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
25th Nov 2009, 03:44 PM #20MemberWebsite's:
warezxtc.com
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Advanced Bash Loops Tutorial
By Albert.Nawaro in forum Tutorials and GuidesReplies: 0Last Post: 9th Feb 2012, 10:56 AM -
[AMS] xCleaner - Cleans your System & Registry ;)
By l0calh0st in forum Web Development AreaReplies: 1Last Post: 24th Jul 2010, 05:10 PM -
Tutorial [Creating a PHP Framework] {advanced} (PART 3)
By litewarez in forum Tutorials and GuidesReplies: 1Last Post: 4th Feb 2010, 02:12 AM -
Tutorial [Creating a PHP Framework] {advanced} (PART 2)
By litewarez in forum Tutorials and GuidesReplies: 2Last Post: 3rd Feb 2010, 05:37 AM
themaRegister - register to forums...
Version 3.54 released. Open older version (or...