Results 1 to 4 of 4

Thread: Upload a .txt file and shows content on a new page

  1. #1
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Upload a .txt file and shows content on a new page

    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!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •