Page 1 of 1

Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 6:34 pm
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

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 6:45 pm
by requinix
Perhaps you could post the code for that file?

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 7:25 pm
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.

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 7:29 pm
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.

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 8:43 pm
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:

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 9:12 pm
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.

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 9:33 pm
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.

Re: Strange PHP5 Problem with PNG menu

Posted: Sun Oct 26, 2008 9:54 pm
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.