Reply to Re: Litle Problem . . . . Help Plz . . . :D

Your name:

Reply:


Posted by Toby A Inkster on 03/28/07 10:44

CorfuVBProgrammer wrote:

> class image_manipulation
> {
> private $height;
> private $width;
> public $image;
>
> public function __construct()
> {
> $this->width = 0;
> $this->height = 0;
> }

This is fairly useless.

> public function __destruct()
> {
> $this->width = 0;
> $this->height = 0;
> }

This is entirely useless.

> public function setImageSize($img_tmp)
> {
> $img_info = getimagesize($img_tmp);
> $filetype = $img_info['mime'];
> $this->width = $img_info[0];
> $this->height = $img_info[1];
>
> return $this->manipulate_jpeg($img_tmp);
> }

Considering the main purpose of this function (i.e. to get a manipulated
copy of the image) the above function is bizarrely named.

> <snip rest of class definition>

> $query = "INSERT INTO " . TABLE_NAME . "(img_data) VALUES('" .
> $image_object->setImageSize(FILE_LOCATION) . "')";

You need to escape the result of $image_object->setImageSize using, for
example, mysql_real_escape_string.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация