• Hello, I’ve had a brief search around but couldn’t find an answer – maybe I’m looking in the wrong place and I’m new to WP so go easy.

    I have two similar quetions

    I’d like to automatically fill two seperate sub pages with data from other sources. One is a txt file that comes from a ftp site that is maintained by someone else (location is http://www.sec.noaa.gov/ftpdir/latest/WKHF.txt and it’s updated regularly from the same directory, same file name each time) the other is a gif image that I update daily at home.

    I’d rather not do this manually so if there is a way to do this automatically then I’d be interested to hear either where to look for help or if anyone else does this

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • If URL file access works for PHP on your host (not everyone allows or configures it), you can do something as easy as:

    <?php include('http://www.sec.noaa.gov/ftpdir/latest/WKHF.txt'); ?>

    You can add this either within a custom Page template assigned to a Page:

    http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates

    Or with the use of any of the plugins out there which let you embed PHP in post/Page content:

    http://codex.wordpress.org/Plugins/Posts_Formatting

    Cute additional trick: You can format the text from the NOAA file as regular post content:

    <?php echo apply_filters('the_content', implode('', file('http://www.sec.noaa.gov/ftpdir/latest/WKHF.txt'))); ?>
    Thread Starter g7kse

    (@g7kse)

    Thank you. I’ll give them both a try so at least I’ll know how it’s done both ways next time

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘auto update text file from ftp site’ is closed to new replies.