Web Hosting Forums

Results 1 to 5 of 5

This is a discussion on Qustion that will make me look dumb :-x in the Hosting Talk & Chit-chat forum
Hey everyone I got stumped and I know that I know the answer but its just not coming my little head... Hm, anyways my qustion ...

  1. #1
    Loyal Client
    Join Date
    Sep 2001
    Posts
    92

    Qustion that will make me look dumb :-x

    Hey everyone I got stumped and I know that I know the answer but its just not coming my little head... Hm, anyways my qustion is this, I am running the News PHP script that can be found at http://www.nphp.net its a new posting script anyways, its allows you to build a headlines text, my qustion is how do I make it so that other sites non localhost can grab the text file with out having to redownload it and keep it realtime. I know there is some way to bring the text file i tried the #include virtual="http://www.osbetas.com/nphp/headlines.txt" code having forgot that you can not include virtual from nonlocal host sites. Then i though possible iframe code only problem there is that I want people to be able to stick the code in and around somthing and screw around with the text on there own to make it look good on their sites and not like a peace of crap, Anyones help would be super!
    E-hide.com

  2. #2
    zaw
    zaw is offline
    Loyal Client
    Join Date
    Sep 2001
    Location
    Someplace
    Posts
    157
    Try with php. <? include "nphp/headlines.txt"; ?>

  3. #3
    Loyal Client
    Join Date
    Sep 2001
    Posts
    92
    You dont get it i am tring to take it from my site http://www.osbetas.com which is localhost so that would work, but when i try to go to a non localhost site it does not work well at all. Actually it doesn't work at all...
    E-hide.com

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    The easiest way is probably to do this:

    PHP Code:
    <?
        
    echo(@implode("", @file("http://your.url.here")));
    ?>
    That line will read the file into an array (file()), turn the array into a single string (implode()), and print it to the browser (echo()). The @'s tell PHP to surpress the errors if it is unable to retrieve the file or the file is empty or whatever.

    Not sure if that's quite what your looking for, but I hope it helps.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  5. #5
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    OK, just discovered an easier way...

    PHP Code:
    <?
        
    @readfile("http://your.url.here");
    ?>
    This one does the same thing as my last post with only one command.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

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
  •