jpeg -> php file

Discussion in 'HTML & Website Design' started by vitaminp, Dec 6, 2006.

  1. #1
    I just figured this out and haven't seen anything like it before, I haven't got a blog, and nobody on msn appreciates the fine art of web design... So I thought I'd share it with the dp members.

    Before you read, you might have already known to do this, but its new to me, so atleast humour me

    Basically I've been trying to think of ways to randomly load a jpeg file on an external website - myspace.

    Obviously I cant run php code on myspace, in particular it doesnt have access to my database.

    I did a little testing to see what I could actually do on myspace in regards to tags, and nothing really worked. <OBJECT>,<EMBED> ... Nothing had the desired outcome.

    The only thing that worked the way I liked were the <IMG> tags... So I tried running <IMG SRC='mysite.come/test.php'>... Obviously this didnt work, plus the myspace code is protected from executing php files so it removed the tag.

    (test.php basically sets a jpeg header, gets the image location from the database, and uses gdimage to output that image.)

    Then I thought of another idea... If I set htaccess to point test.jpg to test.php, would it work? Guess what ... It did.

    <img src='http://xoog.net/test.jpg'> now loads a random image from my database.

    OK I've gone on with myself and your probably thinking 'all that... for that?', well something like this will come in *unbelievably* useful for my type of website. Heres a list of things that I, and other gallery-site owners, could do:
    - My members can now have a random image gallery that now updates without them having to change any code
    - I can log imageviews more easily if I add some more code
    - If google classes my images as duplicate content because of the nature of my gallery, i can cleverly put a random string my image paths like this: http://sitename.com/RANDOM.STRING/image.jpeg

    I'd appreciate if somebody could give me some more clever ideas with something like this, as in my eyes I've just opened a world of possibilities for myself.
     
    vitaminp, Dec 6, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Wait until your images are on millions of pages and then sell the ad space to some dodgy company. :)

    Don't worry about the duplicate content issue. Images can't be classed as dup content.

    Try to make your members link back to your site as well rather than just using the image.
     
    mad4, Dec 6, 2006 IP
  3. vitaminp

    vitaminp Peon

    Messages:
    202
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well my site is already extremely busy due to its unique content nature (We take pictures of people in clubs and publish them on the site where there is a member system, etc.)

    I love the idea of selling the adspace :)
    As the images pass through gdimage I can easily add a little branding, I'm sure once enough images are spread on myspace, etc. I can approach some company or other.
    Thanks mad4
     
    vitaminp, Dec 6, 2006 IP