SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy display image by setting the src attribute to a php file

    Hi,

    I have created an application with some images using PHP,APACHE,MYSQL.

    I have set the <img src="img.php?param1=1" >
    where img.php is the php file which retrieves the Blob from the database and displays it here.
    This code works in windows but when we migrated to linux the image is not displayed.

    Could someone help me?

    Thanks in advance

  2. #2
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Osmosys
    Hi,

    I have created an application with some images using PHP,APACHE,MYSQL.

    I have set the <img src="img.php?param1=1" >
    where img.php is the php file which retrieves the Blob from the database and displays it here.
    This code works in windows but when we migrated to linux the image is not displayed.

    Could someone help me?

    Thanks in advance
    try checking your params if in uppper cases or lower cases.. linux is case sensitive

  3. #3
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have checked parameters they are in lower case

  4. #4
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're not assigning $param1 from $_GET['param1'] and register_globals is off, the image will not display...

  5. #5
    SitePoint Member
    Join Date
    Jun 2006
    Location
    Zagreb, Croatia
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not to mention that you have to watch for uppaer - lower case in database fields as well I had a lot of problems migrating a php application wrote by an Windows adminstrator to linux

  6. #6
    SitePoint Zealot
    Join Date
    May 2006
    Location
    Phoenix, AZ
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    on your img.php?param1=1 file, is it just echoing blob data, or did you first add the

    header("content-disposition: image/jpeg"); first, so that the browser will know its streaming a photo?
    Kreative Development
    Infinite Possibilities

  7. #7
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re

    $authorid=$_GET['authid'];
    $sql="select AuthorImage from AuthorProfile where AuthorId=".$authorid;
    $data=mysqli_query($remotecxn,$sql) or die("Couldn't execute query.");
    $row=mysqli_fetch_row($data);
    $image=$row[0];
    Header ("Content-type: pjpeg");
    print $image;
    this is the code in img.php. i have checked the database fields but they r correct.This code is working on windows but not displaying the image in the linux.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •