Page 1 of 1

append part of php file

Posted: Mon Feb 06, 2012 4:51 am
by zachman61
What i'm trying to do is upload a file, and create a div inside of the page which has an image relating to the file depending on a setting in the program.
But I have no idea on how to achieve this.
I'll make an example of what I want as an image
Image

I want it to choose the picture via the program, which will have a combobox.

Basically I want it to do create a new version of the code below for each file uploaded, with a link to the file.
Code: Select all
<div class="mw3file"><img src="mw3.jpg" title="Modern Warfare 3 Render Pack" /><br /><a href="files/renderpack.zip">Modern Warfare 3 Render Pack.zip</a></div>

Re: append part of php file

Posted: Mon Feb 06, 2012 5:05 pm
by Axel
What is stored in the file ? what is the file? I didn't get your question too well lol

Re: append part of php file

Posted: Mon Feb 06, 2012 11:42 pm
by mandai
Is this being used on a web server or is it offline?

Re: append part of php file

Posted: Tue Feb 07, 2012 3:00 am
by zachman61
Axel wrote:
What is stored in the file ? what is the file? I didn't get your question too well lol
The file is a savegame that is uploaded via the program and php, but I want when its uploaded the php file with edit another php file and insert the container posted above.
mandai wrote:
Is this being used on a web server or is it offline?
Its on a web server.

Re: append part of php file

Posted: Wed Feb 08, 2012 11:13 pm
by mandai
You might want to use a PHP script to list the files in a directory and output the HTML.
You could also use a script to upload files.

Re: append part of php file

Posted: Thu Feb 09, 2012 1:00 am
by zachman61
mandai wrote:
You might want to use a PHP script to list the files in a directory and output the HTML.
You could also use a script to upload files.
I tried making my own script using a form, but I couldn't get it to only upload a specific extension.