Yes, that can be done, in many different ways, but you will need more than just a basic knowledge of PHP. I write many such scripts in my PHP programing.
If you need the person to upload contents such as photos and videos, then you need to use a form with a multipart/form-data attribute.
<form name="uploadafile" method="POST" action="uploadafile.php" enctype="multipart/form-data">
If it's just uploading an HTML text file you just might want to use a form with a simple text box and have your script just save the content of that text box into a filename the surfer chooses as well in that form.
Modifying the index page or any page that will get the link can be done by using HTML remark as tags (just insert your links within those tags.):
<!-- start links here --> <!-- end links here -->
The same script that receives the file can modify the index page to get the links. The script you write will look for these tags and parse the index file and add the new link in between those tags.
There are many ways to get this done but it will depend on how your website is structured. For example, perhaps there is a links file that holds the links and is included in the index page, in this case you add the links there.
Also, for HTML pages, you need to keep security in mind. What HTML is allowed on these pages? And what about java scripts? etc. A form like this should only be allowed in an admin panel and used by trusted users.
Do a search on google with keywords such as "forms" "uploads" "php". You should get plenty of tutorials.
Hope that helps.
|