Warptweet Posted December 17, 2006 Share Posted December 17, 2006 Hi there. My website has a file uploading system, which people can upload their games. The only thing is, once they upload their game, they cant download or see it on my website!My website is as of now incomplete. I need a way so that my downloads page lists ALL the uploaded files in my /uploads directory, BUT, I need another thing...I need a code to MAKE a brand new page, for EACH and EVERY uploaded file in the /uploads directory. For instance, newgrounds.com, it creates a page for EACH and EVERY flash file uploaded to their website, with a downloads link. How can I do this?Anyone have a tutorial for php page creation like this? Quote Link to comment Share on other sites More sharing options...
lucasl Posted December 17, 2006 Share Posted December 17, 2006 Well, I don't know about the images, but I would of thought the easiest way would be to put the names/links in a mysql and write an html file with php fwrite(). Quote Link to comment Share on other sites More sharing options...
marcus Posted December 17, 2006 Share Posted December 17, 2006 [code]<?php$filename = $_POST['filename'];$newfile = fopen("/uploads/$filename.php", "x");if($newfile){echo "$filename.php created";}else {echo "failure";}?>[/code]If the file exists it wont do anything, if it doesn't PHP will try to create it. Quote Link to comment Share on other sites More sharing options...
trq Posted December 17, 2006 Share Posted December 17, 2006 Theres no need to make a new page for each game uploaded. Search the board for threads on making [i]profile[/i] pages. Its the same sort of concept and has all been explained before. Quote Link to comment Share on other sites More sharing options...
Warptweet Posted December 17, 2006 Author Share Posted December 17, 2006 I thank you all so dearly for the help. BUT, instead of a profile page, I need the download page that is created to have a download link. So this is somewhat different. Quote Link to comment Share on other sites More sharing options...
trq Posted December 17, 2006 Share Posted December 17, 2006 [quote]So this is somewhat different.[/quote]No it isn't. The concepts are much the same. A big part of learning to program is learning to think about solutions based on simular problems. You'd be suprised how much stuff is simular.Think of it like this. Normally a [i]profile[/i] page might display info about a certain user. Instead, you want it to display info about a certain file. Its really no different.The first thing you need to do is creeate a table to store the names of your files along with the location they are stored at. Once this is built you have a script which updates this database everytime a file is added.Next, you need a page which lists the names of all these files as links to there respective pages.Then, on the pages themselves you can create the download links.Its the same basic concept, you just need to think a little differently. Quote Link to comment Share on other sites More sharing options...
Warptweet Posted December 21, 2006 Author Share Posted December 21, 2006 Yes... but, I need the following:A way to make a form with the following possible entries:Download Link:Screenshot Link:Author:Description:------------------------------------And after they click the submit button, it will submit the data to a database or make a php file or something.Of course, I have a .com website and have unlimited databases available, support php and many more codes.So I wont mind if somebody gives me a code that uses mysql or anything.BUT, I also need a code that creates a table on the downloads page:Game l Author l l l lThe "Author" will take the name of the creator which was submitted, and display it.The "Game" will create a link to a download page that is automatically created, which will display the "Download Link" which was added at the form I stated before, the download page will also display a screenshot by using the link to the screenshot image in the "Screenshot Link" field I stated above, and the download will also display the Author of the game again, and the Description aswell which would be submitted at the "Author" and "Description" field that I said above.Does anyone have a code for this?I'm quite sure this has been done many many times, simply storing information.By the way... I'm not asking for an uploader. The "Game Link" can be attached to the same file storing the "Game Link" "Screenshot Link" "Author" and "Description", which can probably be stored as variables, and recalled. Quote Link to comment Share on other sites More sharing options...
trq Posted December 21, 2006 Share Posted December 21, 2006 Your missing the point of this forum. We don't do [i]code[/i] for people. If your looking for a programmer post in the freelance forum, otherwise, post your specific problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.