View more - Mini OOP wrapper for Mysql PHP functions
Posted by nebiros on Fri Feb 26 16:51:47 UTC 2010. Language php

<?php

class App_Db_Adapter_Mysql
{
    protected $_options = array(
        "host" => "localhost",
        "username" => "root",
        "password" => "",
        "dbname" => ""
    );
        

View more -
Posted by nebiros on Fri Feb 26 14:23:17 UTC 2010. Language php

<?php

if ( false === empty( $_FILES ) )
{
    $extExplode = explode( ".", $_FILES["image"]["name"] );
    $ext = strtolower( array_pop( $extExplode ) );
    $uniqId = md5( uniqid( rand(), true ) );
    $imageFilename = "{$uniqId}.{$ext}";

    if ( false === move_uploaded_file( $_FILES["image"]["tmp_name"], APPLICATION_PATH. "/images/{$imageFilename}" ) )