Get a value from a text file.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aquatic
    New Member
    • Oct 2007
    • 5

    Get a value from a text file.

    Hi,
    I have basic HTML pages with products and prices in them, and the prices change regularly.
    What I would like to do is to use a plain text file with a list of the prices in (that I can easily change and upload), then the HTML pages get their prices based on a name or variable extracted from the text file.
    Is this possible ?

    Regards,
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by Aquatic
    Hi,
    I have basic HTML pages with products and prices in them, and the prices change regularly.
    What I would like to do is to use a plain text file with a list of the prices in (that I can easily change and upload), then the HTML pages get their prices based on a name or variable extracted from the text file.
    Is this possible ?

    Regards,
    Sure, but not with HTML alone. You will need something like Perl to code what you want to do.

    The Perl CGI module can be used to accomplish this task.

    Regards,

    Jeff

    Comment

    • FullyH3ktik
      New Member
      • Sep 2007
      • 52

      #3
      You might be able to use PHP, here is a tutorial for doing such a task
      W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

      Comment

      • Aquatic
        New Member
        • Oct 2007
        • 5

        #4
        Thanks for that, but I think that's all a bit above me.
        I can "tinker" and "mess about" with complete files until they do what I want, but I havn't a clue how to write a complete program from scratch.
        The .php tutorial was on the right lines, but I wouldn't know how to extract certain words or numbers from a list to put them in specific positions in my .html pages.
        Thanks again for your help, I think I'll just have to keep 'wandering the net' to find someone who has written a similar thing, and use that as a frame for what I need.
        Regards,

        Comment

        • Aquatic
          New Member
          • Oct 2007
          • 5

          #5
          Sorry, but I just had a thought........
          Couldn't I use the <a> tag with name= and id= ?
          Or am I on the wrong tack ?

          Regards,

          Comment

          • FullyH3ktik
            New Member
            • Sep 2007
            • 52

            #6
            Originally posted by Aquatic
            Sorry, but I just had a thought........
            Couldn't I use the <a> tag with name= and id= ?
            Or am I on the wrong tack ?

            Regards,
            Yes you can use the id and name attributes with an anchor

            Comment

            Working...