Duplicate and Embbedd

begamer26

New Member
Messages
24
Reaction score
0
Points
0
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
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
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.
 

begamer26

New Member
Messages
24
Reaction score
0
Points
0
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
 
Top