Strange PHP5 Problem with PNG menu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jayman30
Forum Newbie
Posts: 6
Joined: Sat Jul 12, 2008 6:59 pm

Strange PHP5 Problem with PNG menu

Post by jayman30 »

Hi,

My host recently upgraded the server I host my Photo Web Site at http://www.photographybykh.com to PHP 5 and MySQL 5.

I'm now having a strange problem. The site uses generated PNG menus that are editable as plain text in smarty templates. The menu items are all showing as broken images and running the menu script directly produces apparently corrupt output.

For example:
http://www.photographybykh.com/site_tit ... itle=ABOUT returns the text characters "mÊzZ‘éÜ" instead of generating a PNG with "ABOUT" as its title. Any text typed directly into the URL after "title=" returns mÊzZ‘éÜ

This problem began after I removed a PHP4 handler from my .htacess file. The handler had to be removed because the script was not closing client connections and over-loading the server.

I don't know where to start on this one--any suggestions?

Thanks,

jayman30
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Strange PHP5 Problem with PNG menu

Post by requinix »

Perhaps you could post the code for that file?
jayman30
Forum Newbie
Posts: 6
Joined: Sat Jul 12, 2008 6:59 pm

Re: Strange PHP5 Problem with PNG menu

Post by jayman30 »

Here you go.

Code: Select all

<?
    
 
    include("setting.php");
 
    $file           = "$title.png";
    $text           = $title;
    $back_color     = array(153, 153, 153); // (red, green, blue)
    $front_color    = array(255, 255, 255); // (red, green, blue)
 
    $font_file      = 'files/font/aglettericacondensedbold.ttf';
    $font_size      = 10;
    
    $image_width    = (strlen($text)) * ($font_size - 1) + 20;
    $image_height   = 25;
    
    
    $position_left  = 10;
    $position_top   = 17;
    
    include("system_function_title.php");
 
 
 
?>
 
 
Thanks for looking in to this problem.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Strange PHP5 Problem with PNG menu

Post by requinix »

Not much there to see...

Code: Select all

$text           = $_GET["title"];
Try that.

And I'd suggest putting

Code: Select all

Options -Indexes
in your .htaccess file, otherwise people can look through your folders.
jayman30
Forum Newbie
Posts: 6
Joined: Sat Jul 12, 2008 6:59 pm

Re: Strange PHP5 Problem with PNG menu

Post by jayman30 »

Hi,

Thanks for the suggestions I had my CPanel's Index Manager set to keep my folders from being browsed--but I guess that wasn't working? Thanks for the tip, that could have been costing me sales.

I tried changing

Code: Select all

$text           = $title;
to

Code: Select all

$text           = $_GET["title"];


but no luck. Anything else I could try? :banghead:
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Strange PHP5 Problem with PNG menu

Post by requinix »

Oh, missed it. Do the same thing with the $title in $file.

If not then it might help to see what's in system_function_title.php.
jayman30
Forum Newbie
Posts: 6
Joined: Sat Jul 12, 2008 6:59 pm

Re: Strange PHP5 Problem with PNG menu

Post by jayman30 »

Changed

Code: Select all

$file           = "$title.png";
to

Code: Select all

$file           = "$_GET["title.png"];
No luck there either, I'm afraid the developer codelocked system_function_title.php for copy protection and I've been trying to contact him for over a week now. :(

Thanks for the help though, at least it was worth a shot.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Strange PHP5 Problem with PNG menu

Post by requinix »

So I assumed you knew what to do. My mistake.

Code: Select all

$file = $_GET["title"] . ".png";
Hard to debug code when you can't see the code.
Post Reply