View Full Version : Upload a .txt file and shows content on a new page
Briggs
02-20-2008, 12:57 AM
Ok, firstly I'm using a php template.
Now, what I want to do is allow a person to upload a .txt file, the content of that file is showed on a new page, and that new page will be linked to the main page.
Any info would be great!
djr33
02-20-2008, 02:16 AM
Do you want this to be stored on the server? In a database? Just one time use?
For a broad question, here are some broad answers, but they should help you on your way:
1. Everything you need to know about starting up with a PHP/MySQL database system:
http://php-mysql-tutorial.com
2. PHP file uploads:
http://www.php.net/manual/en/features.file-upload.php
3. Some notes:
file_get_contents() (look this up at php.net) will grab the contents of a file if you'd rather not use a database.
Just simple echo, etc, will output the text from a variable, from file_get_contents(), etc.
Briggs
02-20-2008, 03:09 AM
Hmm, I'm not really sure which would be best for what I need.
This is going to be used to allow people to upload deck lists for a card game. So I'd like it to be permanent.
Server side would probably be best for my situation though, as I really don't know anything about databases
djr33
02-20-2008, 03:37 AM
Well, that tutorial gets you started, right from the beginning. The only thing it skips is attaining one in the first place. (Check with your host, and if not, then consider getting a better host.)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.