PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 3rd, 2003, 12:37 PM
socio socio is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 7 socio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP 4.3 and GD problem with win 2k???

Hi members,

i upgraded my PHP distribution from 4.1.2 to 4.3.0 on my test web hosts:

The first was running PHP 4.1.2 on Windows NT4 Server with IIS 4 and has the gd library 1.6.4 enabled;

the second one was running PHP 4.1.2 on Windows 2k Pro and Apache 1.3.27 with the same gd library of the previous enabled.

A PHP script allowed any user to insert by mean of a form to insert a png or jpeg image in a mysql database as a blob file. A second script allowed to display this blob file in a browser window by mean of a gd function.

After upgrading to PHP 4.3 the script can't display right images in the browser windows on both servers.
After some investigations I noticed that when the first script tries to insert the image as a blob file in the mysql database, the file content is cutted off.

P.S.: php.ini settings are the same on both servers.

The Register_Global variable was set to 'Off' both with PHP 4.1.2 that PHP 4.3.0.

Is there anione who can help me?

Reply With Quote
  #2  
Old February 6th, 2003, 04:48 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: PHP 4.3 and GD problem with win 2k???

It sounds like the data is not being escaped properly...make sure it is run through addslashes before going into the database...

Reply With Quote
  #3  
Old February 6th, 2003, 08:50 AM
socio socio is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 7 socio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP 4.3 and GD problem with win 2k???

I'm sure that script run addaslashes before insertion into database. The script was working fine with PHP 4.1.2 realese and gd library 1.6.2.

So here you are a piece of code of push db data script:

<?php

...
if (isset($news_photo) && $news_photo != "none") {

// replace string ...\... ......
//$mstr=preg_replace("[x5c{2}]","\",$news_imgpath);
// replace local drive units with their hostname
$imgpath = preg_replace("/.:/",$host_path, $news_imgpath);

$news_imgfile = addslashes(fread(fopen($news_photo, "r"), filesize($news_photo)));
$news_ftype = $_FILES['news_photo']['type'];
$news_fsize = $_FILES['news_photo']['size'];
$size = @getimagesize($news_photo);
$imgwidth = $size[0];
$imgeigth = $size[1];

$sstr = "INSERT INTO $table_news (news_user, news_title, news_date, news_day, news_month, news_year, news_short, news_long, news_hits, news_photo, news_ftype, news_fsize, news_class, news_imgpath, news_imgwidth, news_imgeigth) "."VALUES ('$news_user', '$news_title', '$news_date', '$news_day', '$news_month', '$news_year', '$news_short', '$news_long', '$news_hits', '$news_imgfile', '$news_ftype', '$news_fsize', '$news_class', '$imgpath', '$imgwidth', '$imgeigth')";

}

...

>

Any other ideas about it?

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > PHP 4.3 and GD problem with win 2k???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway