|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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...
|
|
#3
|
|||
|
|||
|
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? |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > PHP 4.3 and GD problem with win 2k??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|