![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Ok, I have a very weird problem here. I want to use .php to create thumbnails. For this, I use the following code: <? $file = isset($_GET['file']) ? $_GET['file'] : exit; //Load the image $src = imagecreatefromjpeg($file); if($src) { $width = ImageSx($src); $height = ImageSy($src); $maxwidth = 140; $maxheight = $maxwidth / 1.333333; if($width > $height / 1.333333) { $newwidth = $maxwidth; $newheight = $height / ($width / $newwidth); } else { $newheight = $maxheight; $newwidth = $width / ($height / $newheight); } $dest = ImageCreate($newwidth, $newheight); ImageCopyResized($dest, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); header("Content-Type: image/jpg"); Imagejpeg($dest); exit; } ?> This file is called showthumb.php. Now in my C:\inetpub\wwwroot\ directory (Yes, im doing this all under windows) I create a file called test.html (after having some trouble, but this will explain the problem). I put the following data in this test.html: <img src=http://localhost/showthumb.php?file=pic.jpg> (where pic.jpg was a valid .jpg file inside the C:\inetpub\wwwroot\ directory) I opened this file in internet explorer by going to C:\inetpub\wwwroot\test.html. It worked, the image got displayed (although the colors where screwed up, but that i might be able to fix that myself). I went to http://localhost/test.html (Thus the same .html file) and it did not display the image! It just kept loading without actually doing anything. I tried the same in Mozilla Firebird... Not a single problem. both C:\inetpub\wwwroot\test.html and http://localhost/test.html showed the picture as expected. Now: What's wrong? How can I fix this crap? Thanks | |||
| | #2 | ||
| amazing how some things in internet explorer work again when you close all ineternet explorer windows! Problem somehow fixed ![]() "Spoofed Existence" <spoofedexistence@hotmail.com> schreef in bericht news:3f2cd089$0$147$1b62eedf@news.wanadoo.nl... > Ok, I have a very weird problem here. I want to use .php to create > thumbnails. For this, I use the following code: > <? > $file = isset($_GET['file']) ? $_GET['file'] : exit; > > //Load the image > $src = imagecreatefromjpeg($file); > if($src) > { > $width = ImageSx($src); > $height = ImageSy($src); > > > $maxwidth = 140; > $maxheight = $maxwidth / 1.333333; > if($width > $height / 1.333333) > { > $newwidth = $maxwidth; > $newheight = $height / ($width / $newwidth); > } else { > $newheight = $maxheight; > $newwidth = $width / ($height / $newheight); > } > > $dest = ImageCreate($newwidth, $newheight); > ImageCopyResized($dest, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, > $height); > > header("Content-Type: image/jpg"); > Imagejpeg($dest); > exit; > } > ?> > > This file is called showthumb.php. Now in my C:\inetpub\wwwroot\ directory > (Yes, im doing this all under windows) I create a file called test.html > (after having some trouble, but this will explain the problem). I put the > following data in this test.html: > <img src=http://localhost/showthumb.php?file=pic.jpg> > (where pic.jpg was a valid .jpg file inside the C:\inetpub\wwwroot\ > directory) > I opened this file in internet explorer by going to > C:\inetpub\wwwroot\test.html. It worked, the image got displayed (although > the colors where screwed up, but that i might be able to fix that myself). I > went to http://localhost/test.html (Thus the same .html file) and it did not > display the image! It just kept loading without actually doing anything. I > tried the same in Mozilla Firebird... Not a single problem. both > C:\inetpub\wwwroot\test.html and http://localhost/test.html showed the > picture as expected. > > Now: What's wrong? How can I fix this crap? > > Thanks > > > > > | |||
| Featured Websites | ||||
|
![]() |
| Tags: forever, loads, problem, strange |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| strange image problem - how does this work? | Mark | HTML | 5 | 07-01-2007 1:46 PM |
| Halo 2 down loads is it true | John 112 via XboxJunkies.com | Console Subjects | 3 | 06-26-2007 2:06 PM |
| Strange Connection Problem | Nate R. | Console Subjects | 3 | 06-26-2007 3:08 AM |
| Xbox Live: Strange Connection Problem ...plz help | Daisy | Console Subjects | 0 | 06-26-2007 1:32 AM |
| MDB2 ibase Reverse: strange case problem | Alessandro Pasotti | Pear | 3 | 05-20-2007 6:34 PM |
| Featured Websites | ||||
|