Jump to content

alexb27

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

alexb27's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your useful replies, PFMaBiSmAd. I looked at php.ini and observed that error_reporting = E_ALL | E_STRICT and display_errors = On so I left them as that; I commented out the content header in test.php and navigated to it in my browser. The image displayed . I de-commented out and the image still displayed . I added anyhow the two lines of code after <?php in test.php and it showed no error(with content header commendted out and not commented out ). I added the two lines also in test0.php , after each <?php and navigated to test0.php and no error was displayed, and no image also. I'm kind of stuck.
  2. I do have functions that modifies the image. This is a stripped down version of my code. In fact test.php is a reduced version of something like <?php //change this path to match your images directory $dir ='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images'; // make sure the requested image is valid if (isset($_GET['id']) && ctype_digit($_GET['id']) && file_exists($dir . '/'. $_GET['id'] . '.jpg')) { $image = imagecreatefromjpeg($dir . '/' . $_GET['id'] . '.jpg'); } else { die('invalid image specified'); } // apply the filter $effect = (isset($_GET['e'])) ? $_GET['e'] : -1; switch ($effect) { case IMG_FILTER_NEGATE: imagefilter($image, IMG_FILTER_NEGATE); break; case IMG_FILTER_GRAYSCALE: imagefilter($image, IMG_FILTER_GRAYSCALE); break; case IMG_FILTER_EMBOSS: imagefilter($image, IMG_FILTER_EMBOSS); break; case IMG_FILTER_GAUSSIAN_BLUR: imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR); break; } // show the image header('Content-Type: image/jpeg'); imagejpeg($image, '', 100); ?> I am trying to answer this problem by severals days, and i'm ready to give up so any help is really appreciated. Thank you for your answers so far.
  3. for test.php i have used <?php $dir='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images'; $image = imagecreatefromjpeg($dir . '/1.jpg'); ?> and still doesn't work I do not understand. Do you mean <?php $dir='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images'; $image = imagecreatefromjpeg($dir . '/1.jpg'); header('Content-Type: image/jpeg'); imagejpeg($image, '', 100); ?> If so, how will I write test0.php? I do use GD functions in my original code, this is gust a reduced version of it.
  4. I have tried test0.php <html> <head> </head> <body> <?php include 'test.php'; ?> <img src="<?php echo $image; ?>"/> </body> </html> and test.php <html> <head> </hesd> <body> <?php $image = imagecreatefromjpeg('images/1.jpg'); ?> </body> </html> and also <html> <head> </hesd> <body> <?php $dir='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images'; $image = imagecreatefromjpeg($dir . '/1.jpg'); ?> </body> </html> but it's not working
  5. Hi all, I am trying to send an image through header so I have two php files: test0.php <html> <head> </head> <body> <?php $imagename='test.php'; ?> <img src="<?php echo $imagename; ?>"/> </body> </html> and test.php: <html> <html> <head> </hesd> <body> <?php $image = imagecreatefromjpeg('images/1.jpg'); header('Content-Type: image/jpeg'); imagejpeg($image, '', 100); ?> </body> </html> but the image doesn't show . What is the correct way? Thank you in advance.
  6. It works with "images/1.jpg" - not jpeg Thank you for your replies.
  7. Hi all, I have the following problem: there is a html file in my htdocs folder, and images in htdocs/images/ ; I specify <img src="C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images/1.jpeg" /> but the image doesn't show in any type of browser. I tried also backslashes, relative path <img src="/images/1.jpeg" /> but that didn't worked eader . If i create a simple html file not in htdocs and put the images in a folder "images" placed in the same folder as the html it works. Why? Is there a solution? Thank you in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.