Programmers or any others i got a ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • juicylinks
    So Fucking Banned
    • Apr 2001
    • 122992

    #1

    Programmers or any others i got a ?

    K

    Need to setup a page that will grab the contents of file and list it . The page it grabs is a txt file....

    How can i do this? Use a SSI includes?
  • Johny Traffic
    Confirmed User
    • Apr 2003
    • 5461

    #2
    I dont know sorry, but can I put my sig in one of Juicys threads anyway please


    hosted flv's, hosted galleries, morphing rss feeds, free content, free sites, hosted blog

    Comment

    • juicylinks
      So Fucking Banned
      • Apr 2001
      • 122992

      #3
      Originally posted by Johny Traffic
      I dont know sorry, but can I put my sig in one of Juicys threads anyway please
      sure

      Comment

      • psili
        Confirmed User
        • Apr 2003
        • 5526

        #4
        a simple php page:

        $fileToGrab = '/path/to/file.txt';

        print ( implode('',file($file) );



        if you don't need any special formatting.
        Your post count means nothing.

        Comment

        • juicylinks
          So Fucking Banned
          • Apr 2001
          • 122992

          #5
          Originally posted by psili
          a simple php page:

          $fileToGrab = '/path/to/file.txt';

          print ( implode('',file($file) );



          if you don't need any special formatting.
          thanks man ill test it now.

          Comment

          • psili
            Confirmed User
            • Apr 2003
            • 5526

            #6
            make sure you make note of how i didn't reference the second "file" variable correctly becuase I'm retarded


            $fileToGrab = '';
            print (implode('',file($fileToGrab)));
            Your post count means nothing.

            Comment

            • Johny Traffic
              Confirmed User
              • Apr 2003
              • 5461

              #7
              sure
              I'll be honest I didnt really even understand the question, let alone, know the answer


              hosted flv's, hosted galleries, morphing rss feeds, free content, free sites, hosted blog

              Comment

              • juicylinks
                So Fucking Banned
                • Apr 2001
                • 122992

                #8
                Originally posted by psili
                make sure you make note of how i didn't reference the second "file" variable correctly becuase I'm retarded


                $fileToGrab = '';
                print (implode('',file($fileToGrab)));
                works like a charm.... now how do i get the output to be one item per line?

                Comment

                • juicylinks
                  So Fucking Banned
                  • Apr 2001
                  • 122992

                  #9
                  PHP Code:
                  <?php 
                  $fileToGrab = 'juicy.txt';
                  print (implode('',file($fileToGrab)));
                  ?>

                  thats what i got

                  Comment

                  • psili
                    Confirmed User
                    • Apr 2003
                    • 5526

                    #10
                    You dumping to an HTML window ?

                    Try this:

                    $fileToGrab = "juicy.txt";

                    print ( preg_replace("/\n/","<br>",implode("",file($fileToGrab))) );



                    might not be the most elegant, but it should work.
                    Your post count means nothing.

                    Comment

                    • swedguy
                      Confirmed User
                      • Jan 2002
                      • 7981

                      #11
                      Originally posted by psili
                      You dumping to an HTML window ?

                      Try this:

                      $fileToGrab = "juicy.txt";

                      print ( preg_replace("/\n/","<br>",implode("",file($fileToGrab))) );



                      might not be the most elegant, but it should work.
                      Or even easier, use nl2br()



                      <?
                      print nl2br(implode("",file("juicy.txt")));
                      ?>

                      Comment

                      • psili
                        Confirmed User
                        • Apr 2003
                        • 5526

                        #12
                        Originally posted by swedguy
                        Or even easier, use nl2br()



                        <?
                        print nl2br(implode("",file("juicy.txt")));
                        ?>
                        See..... That's lovely right there.
                        Your post count means nothing.

                        Comment

                        • juicylinks
                          So Fucking Banned
                          • Apr 2001
                          • 122992

                          #13
                          niceeeeeeeeee

                          Now ill set up a cron job to update the php file.

                          Comment

                          Working...