Jump to content

JREAM

Members
  • Posts

    127
  • Joined

  • Last visited

Posts posted by JREAM

  1. // way 1... (But im not sure how I can hold the errors inside the Blah class) everytime an item is called
    class Blah {
    public function __construct()
    {
    	$this->slice = new Slice();
    	$this->thumb = new Thumb();
    }
    }
    
    $blah = new Blah();
    $blah->slice->file('test.jpg');
    
    // Way 2
    class Blah {
    
    public function __construct()
    {
    	$this->_slice = new Slice();
    	$this->_thumb = new Thumb();
    }
    
    public function slice($arg)
    {
    	$this->_slice->{$arg[0]}($arg[1])
    }
    
    public function thumb($arg)
    {
    	$this->_thumb->{$arg[0]}($arg[1])
    }
    
    }
    
    $blah = new Blah();
    $blah->slice('file', 'test.jpg');
    

     

  2. Hi, I'm Jesse --

    I'm located in Deltona FL.

     

    At the time of posting, my rate is based on the estimated duration ~25 USD / hour.

     

    You can find my example work/projects listed on my main site http://jream.com/

    The best way to reach me is through Email  contact@jream.com

    Or on Yahoo: AniYishay

     

    Overview

    I work from Ubuntu (LAMP) and Windows XP (WAMP). I'm not an expert with Apache, but I am familiar enough to configure things.

     

    PHP OOP: You can see some of my projects on my site above. I don't have perfect knowledge of all the design patterns but I'm familiar with some, I also am not an expert with every framework out there, there are just too many.

     

    MySQL: I am not a DBA by trade, but I am great at building applications with MySQL.

     

    JQuery: Im not too bad at this, I don't use it all the time. AJAX is very possible, but keep in mind it adds another layer of time to the work.

     

    CSS/XHTML: Everyone pretty much knows these, I don't validate for IE6 anymore, sorry.

     

    Photoshop/Illustrator: I've done a lot of graphic work. I guess if you like my style you like it, otherwise no need to use me for this.

     

    Greatest Strength: Organization

    Greatest Weakness: Math & Math Formulas

  3. I can't remember but you can install GD this way:

    sudo apt-get install php5-gd

    /etc/init.d/apache2 restart

     

    But i installed PHP with:

    sudo apt-get install php5 libapache2-mod-php5

     

    and GD and a ton of mods were included.

     

    The php INI file is I believe here:

    /etc/php5/apache2/php.ini

  4. You can tell this causes an error:

    $set = array(1, 2, 3, 4);
    $set = array(5, 6, 7, ;

     

    So I could do

    $set = array(1, 2, 3, 4);
    $set2 = array(5, 6, 7, ;
    $all = array_merge($set, $set2);

     

    And also

    $set = array(1, 2, 3, 4);
    $set[] = 5;
    $set[] = 6;
    // etc.

     

    But is there a way to do like..

    $set = array(1, 2, 3, 4);
    $set .= array(5, 6, 7, ; // Notice the period

     

  5. Hmm maybe AJAX is the best option to do such a thing.

    I thought for a moment to use a 1x1 iframe to go to the url but Im still not sure if that would work out right lol.

     

    I plan to encrypt only one file so people cant rewrite the thing to mess with it.

  6. This is very messy!

     

    1. I would look up Naming Conventions, you have very hard to read variables, no need to use Login_User, when you are using the _ for a spacer, you could just use login_user; alternatively without the _ spacer you could do loginUser (camelCase).

    2. Too many nested if/else statements!

    3. Possibly break things into a few more functions

    4. Make comments in your code, when you come back to this in a few months I think you will be very confused!

    5. Your naming is confusing, perhaps rename your database logic to differentiate between the two (SysCheck rather than LoginCheck, and space out your query to be readable)

          $SysCheck = $DB->query("
    		SELECT 	id,username,account_status,suspended_timestamp 
    		FROM 	members 
    		WHERE 	username='$Login_Username' 
    		&& 		password='$Login_Password'");
    
      /** Login Status counts if a user exists with user/password combo */
          $Login_Status = $SysCheck->num_rows;
          $Login_Information = $SysCheck->fetch_object();
    

     

    6. $DB->real_escape_string is unnecessarily long to type out, why not just name the method $DB->clean or something, I can't imagine typing those underscores so much is that enjoyable!

     

    7. An example function

      function ValidUser($str)
      {
    /** Returns a Boolean */
    return preg_match("/^[a-z0-9]{2,20}$/i", $str) || preg_match("/^[a-z0-9]{2,20}$/i", $str);
      }
      
      
    case "Login":
    
    if(!ValidUser($_POST["F_1_Login_Username"]) {
    	$Login_Error = "INCORRECT ACCOUNT INFORMATION";
    }

  7. I have software that people install.

    When they install it, is there a way to make it post their domain name to my website?

     

    I know I could do a header('location: http//www.mysite.com/id=?domain.com'); then handle it anyway from mysite.com I wanted. But I don't want to force the user to to actually go to my page.

     

    I dont know much about cURL or what it does, hopefully I dont have to use it because I dont want to require additional plugins for the current software.

     

    Is there a way to post to another domains url without actually refreshing the page?

  8. What is the error you are getting? It won't send an email to "email", has to be a real address. Im guessing you just edited that.

     

    Here is a good header:

    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $from" . "\r\n" .
    	"Reply-To: $from" . "\r\n" .
    	'X-Mailer: PHP/' . phpversion();
    

  9. How do I get a variable from the new User Class to echo out in this clasS?

    class MyApp
    {
    
    function __construct()
    {
    	global $dbHost;
    	global $dbUser;
    	global $dbPass;
    	global $dbName;
    
    	$this->DB		= new Database;
    	$this->DB->connect($dbHost, $dbUser, $dbPass, $dbName);
    
    	$User		= new User;
    
    	echo $User->login;
    	echo $this->User->login;
    
    }	
    
    
    }
    
    

  10. Im trying to make this so that it will either INSERT or UPDATE

     

    Based upon IF assign_bot and assign_user exist in one row,

    Then UPDATE, If it's false, then INSERT.

     

    INSERT INTO tmp_battles
                SET
                `assign_bot` = '$bot[id]',
                `assign_user` = '{$sess->get('userID')}',
                `battle_hp` = '$bot[hp]'
               
                ON DUPLICATE KEY
                    UPDATE `battle_hp` = '$bot[hp]'
    

     

    I don't have a real foreign key because I use MyISAM not InnoDB, therefor I don't know If the duplicate key is doing anything here.

  11. I don't know what my problem is today.

    I have this working, print_r($admin) works.

     

    but I have to do this to retrieve a value:

    $admin[0]['title'];

    Is there a way I can do this without the digit?

    $admin['title'];

    since im only getting one result back?

    $sql = "SELECT * FROM users WHERE `id` = 0 LIMIT 1";
    $result = mysql_query($sql);
    
    $admin = array();
    while ($query = mysql_fetch_array($result)) {
    $admin[] = $query;
    }
    
    if(empty($admin))
    {
    $admin = NULL;
    }
    

  12. I almost have it, what do i need  to ignore any file?

    I know if i do it ill end up doing way too long :( is there an easy way to do this?

    function themeList ($directory) {
    
        $results = array();
        $handler = opendir($directory);
    
        while ($name = readdir($handler)) {
            if ($name != '.' && $name != '..') {
    
    			$results[] = $name;
    	}
        }
        closedir($handler);
        return $results;
    }

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.