Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    2
    Member #
    20314
    I want to get data from a data file and present into a webpage. Let me explaim more...

    From a PICAXE microcontroller I can send say a temperature value using FTP and dumping it into say an ascii data file on my webhost site. The micro can customise the data into any format required to suit.

    Then I want a web page to access that data file and show it in the web page then periodically update the presented data.

    Once I master being able to get the data across I want to eventually then get to the stage of having a graphic representing my home and then show on the web page various space temperatures

    Maybe there is a hyperlink instruction format I've not yet discovered without any detailed web page programming

    Any ideas / examples

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    You will be using PHP to read that ASCII file.

    Post an example of what that file contains, exactly how the file looks.

    Using PHP, you can read data in files and process the data, outputting
    the HTML to view your page. That HTML file can refresh automatically.

    If you hooked-up your controller to an embedded web server, like this:
    http://www.netmedia.com/siteplayer/index.html

    You could actually put it on a network and create web pages directly
    from your controller. It has its own web pages, and also, other PHP
    scripts can access it directly ... almost limitless possibilities.

    They use these embedded servers inside of vending machines.
    The servers display temperature and can quantity on their own
    little web pages ... A user on the intranet can simply display whatever
    URL they wish to see each machine, as each machine has it's own IP address.


  4. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    2
    Member #
    20314
    Thanks for the prompt response.
    My ASCII file would be very simple say just"25.7 degrees" without the quotes. Lets call the filename "data.txt"
    I have never got into PHP coding but if you would be kind enough to give me a lead I'll try to follow it from there.
    The link to netmedia looks interesting in fact Silicon Chip magazine in Australia have just published part 1 of a DIY kit which I'm hoping will be less than $100.
    Regards

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Copy and paste the script below using Notepad and save it as "temp.php".
    Upload it to your website, the same directory as "data.txt" and go to the URL
    for "temp.php".

    PHP Code:
    <html>
    <head><title>My Temp</title>
    </head>
    <body>
    <center><br /><br />
    <?php
    // open file
    $temp=file("data.txt");

    // display on page
    echo"
    The temperature is 
    {$temp[0]} degrees.
    "
    ;
    ?>
    </center>
    </body>
    </html>


  6. #5
    Banned
    Join Date
    Nov 2009
    Posts
    19
    Member #
    20316
    HI

    If your are using html than use the folowing cond for hyper link

    <a href="URL">Anchor text</a>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:03 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com