SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    Yeppoon, Australia
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem linking to a dynamic picture

    Hi all,

    I have a script in a page (thumb.php) which returns a jpg image as a stream. It accepts 2 parameters and dynamically produces a resized image. The script works when called explicitly (ie. typing in /thumb.php?id=1&image=2 produces a page with the appropriate resized image) however I want to call it from within my page:

    ie. <img src=thumb.php?id=1&image=2 alt"...">

    but it's not working... as far as I can see the page isn't being called at all and I just get browser image not found errors on the page. This is the code that produces the html for the page. The function that produces it returns $output and then it is echoed later by the calling function.

    PHP Code:
      for ($i=2;$i<=$number;$i++)
      {
        
    //output all images and options - uses thumb.php to dynamically make a thumbnail for each image
        
    $output .= "\n<tr><td>Image $i<br><img src=thumb.php?id=$id&image=$i alt='image $i'></td>
        <td>[<a href='del_image.php?id=
    $id&image=$i'>delete</a>]</td></tr>";
      } 
    The code it makes is correct (html wise) but thumb.php isn't getting called. I think it has something to do with my quoting " or '. Do I need to use eval() or something??
    Knowledge is knowing that a tomatoe is a fruit; wisdom is not putting it in a fruit salad.

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    Yeppoon, Australia
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Turns out none of that was the problem - the source files where not right. Works fine now
    Knowledge is knowing that a tomatoe is a fruit; wisdom is not putting it in a fruit salad.


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
  •