SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Difference between <img> requests and regular http requests

    What are the differences that occur between these two situations:

    <img src="http://www.site.com/page.php">

    and

    <a href="http://www.site.com/page.php">Site</a>

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The fact that one makes an image and one makes a link?

    I think this should be in the HTML forum.

    That first thing will produce an image with the contents of "page.php" in it, and the second one has text saying "Site" linking to the page. What's your question?

  3. #3
    pie??? PIE!!!! rsdl's Avatar
    Join Date
    May 2001
    Location
    Vancouver, BC Canada
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in some cases, the script is a thumbnailer script with functions that modify an image on the fly (i.e. resized, gray scaled..etc), hence you'd need to use the image tag because the script outputs an image and not a link.

  4. #4
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look for the HTTP_ACCEPT header (or something like that). It will have a list of mime types the browser expects. For HTML pages this will be text/html, for images something like image/jpeg or image/gif

    I think you can use the getallheaders function to access this header, if you're using Apache as webserver.

  5. #5
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Captain Proton, you've given me the most helpful responce yet.


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
  •