Reply to Re: [PHP] FREETYPE and GD

Your name:

Reply:


Posted by Richard Lynch on 03/02/05 20:29

Aaron Todd wrote:
> I've created a simple script that takes in image and draws some lines and
> some text on top of it. I am having a problem with the text part of this.
> When the string that I am drawing on the image contains and apostrophe ( '
> )
> there is always a backslash ( \ ) before it. It make sense that it is the
> escape character, but I need to be able to show the apostrophe. Anyone
> have
> any ideas about this?
>
> <?php
> $backdir = "/var/www/html/backgrounds/";
> $im = ImageCreatefromJPEG($backdir.$_GET['background']);

Because you have Magic Quotes GPC on, all GET/POST/COOKIE data
automatically has addslashes called on it, before you see it.

That's "good" because you are probably usually putting your data into a
MySQL database that needs that.

In this case, though, you want to use http://php.net/stripslashes to
"undo" the automated addslashes of Magic Quotes.

Or, if your site mostly/only takes GET data and puts it on images, and
rarely puts it into the database, go ahead and turn Magic Quotes GPC "off"
in php.ini (or in your .htaccess)

Note that you can't turn it off in your script with ini_set since the GPC
data is already altered by the time your script starts.

GD is not really directly involved, per se, in this issue. You'd have the
same problem if you were putting your GET data into a file, or displaying
it directly to the user, or pretty much doing anything at all with it
*except* for stuffing it into MySQL.

--
Like Music?
http://l-i-e.com/artists.htm

[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

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