+ Reply to Thread
Results 1 to 3 of 3

Thread: Duplicate and Embbedd

  1. #1
    begamer26 is offline x10Hosting Member begamer26 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    24

    Duplicate and Embbedd

    Okay, So I have created a file upload system that when you upload a file, it puts a link into my database. But when I go onto the link its JUST the picture/file! Is there anyway I could create a page that gets duplicated in the file upload process and the file gets embedded in the page?

    Kind Regards, BeGamer26

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Duplicate and Embbedd

    For images:
    If the link in the Database is /uploaded/foo.jpg, make the link /display.php?p=uploaded&f=foo.jpg

    Create display.php which will take the query string and create a page with the image embedded.

    You could also do something similar with text files (which would also work with images. display.php would create output a template page with an iframe. The source of the iframe would be /uploaded/filename.txt

    Either way, make sure to test the query string to make sure you end up pointing to an uploaded file and not something you do not want displayed.
    Nothing is always absolutely so.

  3. #3
    begamer26 is offline x10Hosting Member begamer26 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    24

    Re: Duplicate and Embbedd

    Quote Originally Posted by descalzo View Post
    For images:
    If the link in the Database is /uploaded/foo.jpg, make the link /display.php?p=uploaded&f=foo.jpg

    Create display.php which will take the query string and create a page with the image embedded.

    You could also do something similar with text files (which would also work with images. display.php would create output a template page with an iframe. The source of the iframe would be /uploaded/filename.txt

    Either way, make sure to test the query string to make sure you end up pointing to an uploaded file and not something you do not want displayed.
    Thanks! Great help but two questions -

    1. I have an image in /uploaded/art/ so would the query be /display.php?p=uploaded/art&f=foo.jpg ?
    2. In display.php do I need to put any code in it so it embedd's in the exact place I want it?

    Thanks!

    Even KINDER Regards
    BeGamer26

+ Reply to Thread

Similar Threads

  1. Duplicate entry '0' for key 1
    By akselamazigh in forum Programming Help
    Replies: 2
    Last Post: 12-17-2009, 02:49 PM
  2. Duplicate Account
    By Icecoldcoke in forum Free Hosting
    Replies: 0
    Last Post: 11-11-2007, 08:01 AM
  3. Duplicate IP???
    By The Game in forum Free Hosting
    Replies: 22
    Last Post: 01-27-2006, 03:20 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers