Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4590140
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:12:11+00:00 2026-05-21T22:12:11+00:00

I want to show an image and wrote below codes $path = C:\xampp\htdocs\me\1.jpg; $image1

  • 0

I want to show an image and wrote below codes

$path = "C:\xampp\htdocs\me\1.jpg";
$image1 = imagecreatefromjpeg($path);
header('Content-Type: image/jpeg');
imagejpeg($image1);

But when I run it in Firefox it shows:

The image
“http://127.0.0.1/me/Untitled%201.php”
cannot be displayed because it
contains errors.

What is problem?

Edit:

I deleted header function but it has this error:

Warning: imagecreatefromjpeg(C:
mpp\htdocs\me.jpg)
[function.imagecreatefromjpeg]: failed
to open stream: Invalid argument in
C:\xampp\htdocs\me\Untitled 1.php on
line 136

Warning: imagejpeg() expects parameter 1 to be resource, boolean
given in C:\xampp\htdocs\me\Untitled
1.php on line 138

after all works it shows some chars like this

    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ¸)"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ?ùþŠ( Š( Š( Š( Š( Š( Š( Š( Š( Š( Š( Š( Š( Š( Š( Š
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:12:13+00:00Added an answer on May 21, 2026 at 10:12 pm

    In this specific case, you forgot to escape the backslashes \ in the file path. Either use escaped backslashes \\ or – much better – forward slashes: /

       $path = "C:/xampp/htdocs/me/1.jpg";
    

    To debug stuff like this, remove the header() line to see the image’s source code to see the PHP error messages that are breaking it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to show image in a crystal report. Scenario is something like this.
I want to show an image view for three like on/off,if any one have
I want to show the image that mobile phone's camera its taking on a
I want to show an image on my report if that image exists in
When I want to show an image I use something like this: public ActionResult
I have a site for which i want to show a image in india
I need a jquery slideshow with div popup i want to show my image
I am new to web development / php. I want to show an image
I want to show a loading image after page submit. I want it to
I want to show a custom image with some data in it while clicking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.