Re: Special Chars on Form to Image (GD), not displaying properly.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please read below..

> Im having a trouble displaying special characters like #, + on GD (Jpeg) -
> > Image. When i typed in on the form +88 it only shows 88 and the + sign
> is
> > missing.
> >
> > My code:
> >  <?php
> > ..
> > $line_1_1 = urldecode($_GET["line_1_1"]);
>
> You dont want to urldecode() the $_GET vars. PHP already does this
> step.
>
> See what happens with:
>
>   var_dump(urldecode($_GET['line_1_1']));
>   var_dump($_GET['line_1_1']);
>

I tested this not on a GD/Image, but on a plain form and plain var_dump.
The results:

string(1) " "
string(1) "+"

 So, now if i even make a urldecode it also disappers. I think the problem
is when i typed in + on the user input via form. The url converts it
to %2B which
i think is a space. Because as for my example (seen thru the url):

+88and#
When displayed on an image becomes..
 88and

Now, if i made this

+88+and#
It displays..
 88 and#

It converts + to space. Now, how could i filter this properly?

> ...
> > I made a couple of tests and found this variables.
> >
> >  The data that will be pass: +88and#
> > Data from the url (address box): &line_1_1=%2B88and%23
> > Image displayed: 88and - only missing + and #
> >
> > What could i be missing?
>
> Well if you dont use the urldecode() as mentioned above, the only
> reasons i can think of (assuming + will display properly now):
>
>   - The font doesn't have a definition for #
>   - The area isn't big enough so # is getting truncated.


The font is verdana and the image is just normal for its size.

Now, i did this test.

imagettftextalign($background, 8, 0, 385, 120, $black,
"includes/resources/$fonts", "+88+and#$line_1_1", $alignment='R');

This one displays +88+and# properly on the GD image. I only get problems
when displaying it from form to php gd.

What could i be missing? :(

--
Louie Miranda (lmiranda@xxxxxxxxx)
http://www.axishift.com

//JSM-W

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux