How I insert a .txt or csv file to a web page that will update automatically?

Posted on 2014-08-01
Last Modified: 2014-08-01
How I insert a .txt or csv file to a web page that will update automatically?       I am using Dreamweaver CC and the client will be updating the .csv or .txt file.    The client will be updating the .txt or csv file and uploading it.      I want the new data to automatically refresh in the page.
Question by:mmm7786
    LVL 70

    Expert Comment

    by:Jason C. Levine
    You need to use some form of scripting that will parse the file on page load and output the results.  What exactly is this going to do?
    LVL 24

    Accepted Solution

    If all you want to do is include a text file, and you have php enabled, you can use a php directive

    <?php include("text.txt"); ?>

    Author Comment

    It is going to upload inventory for a small car dealership?     Do you have a recommendation for type of scripting?
    LVL 24

    Expert Comment

    This is more complicated than you think. You have to set up some kind of presentation for the uploaded file. The simplest thing to do is have the client upload a text file and you could render it as html or as text. For example, if you host supports php, you could have a file like this:

    <h1> Welcome to the car dealership </h1>
    Here is our current offerings:
    <pre><?php include("text.txt"); ?></pre>
    Thanks for using our site!
    LVL 70

    Expert Comment

    by:Jason C. Levine
    It is going to upload inventory for a small car dealership?     Do you have a recommendation for type of scripting?

    You're actually taking the wrong approach.  You need to start looking into moving away from simple HTML page display and into creating a database-driven display and then give the client the ability to update the database with the inventory CSV via import.

    Dreamweaver can actually assist you with a great deal of this but the following has to happen:

    1) Your hosting plan needs to support both a server-side scripting language (e.g. PHP) and database (e.g. MySQL).  Most do, but you need to check

    2) Someone needs to know basic principles behind creating database-driven content, especially how to create Master-Child displays

    3) Someone needs to know how to configure Dreamweaver to access the database and how to make it do recordsets, repeating regions, and dynamic links

    4) Someone will need to train the client on how to import data to the MySQL database.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now