Search Results

Search found 2 results on 1 pages for 'kolind'.

Page 1/1 | 1 

  • PHP - WideImage class cropping

    - by Kolind
    I am trying to crop a large image to make thumbnails. But I can't get WideImage to save the file. I've tried the following: 1st method: $img = WideImage::load('../files/' . $file_name)->crop('center', 'center', 200, 200); $img->saveToFile('../files/thumb/thumb_' . $file_name); 2nd method: $img = WideImage::load('../files/' . $file_name)->crop('center', 'center', 200, 200); $img->copy('../files/thumb/thumb_' . $file_name); But nothing seems to happen, when I am performing any of these methods. I am getting no errors and no thumbnails. Am I doing something wrong here?

    Read the article

  • PHP - Calling function inside another class -> function

    - by Kolind
    I'm trying to do this: class database { function editProvider($post) { $sql = "UPDATE tbl SET "; foreach($post as $key => $val): if($key != "providerId") { $val = formValidate($val); $sqlE[] = "`$key`='$val'"; } endforeach; $sqlE = implode(",", $sqlE); $where = ' WHERE `id` = \''.$post['id'].'\''; $sql = $sql . $sqlE . $where; $query = mysql_query($sql); if($query){ return true; } } // }//end class And then use this function * INSIDE of another class *: function formValidate($string){ $string = trim($string); $string = mysql_real_escape_string($string); return $string; } // .. on $val. Why doesn't this work? if I write in a field of the form, it's not escaping anything at all. How can that be? * UPDATE * handler.php: if(isset($_GET['do'])){ if($_GET['do'] == "addLogin") { $addLogin = $db->addLogin($_POST); } if($_GET['do'] == "addProvider") { $addProvider = $db->addProvider($_POST); } if($_GET['do'] == "editProfile") { $editProfile = $db->editProfile($_POST); } if($_GET['do'] == "editProvider") { $editProvider = $db->editProvider($_POST); } } //end if isset get do ** The editProvider function works fine except for this :-) **

    Read the article

1