1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

One questions about programming an image hosting...

Discussion in 'PHP' started by cuongdm, May 18, 2005.

  1. #1
    hi,
    I am using PHP to code my image hosting project...
    And i want to know "how many times an image is downloaded?"
    cause we have to give our members a link like:
    --------------
    http://.../imagename.jpg
    not like
    http://..../view.php?name=imagename.jpg
    -----------------
    Now I can't calculate exactly how much bandwidth a member used,
    need your helps...
    SEMrush
     
    cuongdm, May 18, 2005 IP
    SEMrush
  2. Gede

    Gede Peon

    Messages:
    141
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Where is your gallery?

    I think you would be able to do this with a mod_rewrite.

    So you would "serve" an image-23.jpg

    and your mod_rewrite would tranlsate this to

    view.php?image=23 (count and redirect)

    Just a simple example...
     
    Gede, May 18, 2005 IP
  3. MarkB

    MarkB Peon

    Messages:
    33
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could have something like .../img/username/imagename.jpg

    Where /img/ is a php script, /username/ is a variable, and imagename.jpg the filename/variable - so when requested, /img/ will knock up another download count against /username/'s imagename.jpg record.

    If that makes sense :p
     
    MarkB, May 19, 2005 IP
  4. cuongdm

    cuongdm Peon

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks you guys, i'll follow your instrucsions :)
     
    cuongdm, May 19, 2005 IP