I am trying to integrate Linkman (Link Exchange script) into my wordpress.
Currently this is the structure of my Wordpress
http://www.website.com/blog/

And this is the structure of my linkman
http://www.website.com/linkman/

I want http://www.website.com/blog/wp-content/themes/kubrick/page.phpto echo/print out a text file from http://www.website.com/linkman/linkinfo.txt

I think this should be the original php file taken from linkman folder that echo/print out the linkinfo.txt

<?php
require "settings.php";
require_once("header.txt");

$lines = array ();
$lines=file($settings['linkfile']);

echo "<p class=\"linkman\">";

foreach ($lines as $thisline)
{
    $thisline=trim($thisline);
    if (!empty($thisline)) {
        list($name,$email,$title,$url,$recurl,$description)=explode($settings['delimiter'],$thisline);
        if ($settings['clean'] != 1) {$url="go.php?url=".$url;}
        echo "<a href=\"$url\" target=\"_new\" class=\"linkman\">$title</a> - $description<br>\n";
    }
}
?>

Problem is, according to the structure of where the files is, I can't use the code above.
How should I modify them? I tried changing around but couldn't get it to work.
Would really appreciate any help... Thanks in advanced.

    None of your links work. The page you requested is unavailable!

      Include works just as well as readfile for reading a txt file and printing it to the screen. The difference is negligible.

        samudasu wrote:

        The difference is negligible.

        Well, the only difference really is:

        Instead of just outputting the file, the PHP interpreter scans it for PHP code to execute. The amount of time wasted scanning the file can only increase with filesize. If you're include()'ing a file from a remote source... anyone who has access to that file in essence has access to your server as well.

        If you can call that negligible, then... yeah, I guess the difference is 'negligible.'

          Well the include file isn't on a remote server as far as i can tell from the original post so worrying about a remote hack at this point is pointless.

          Maybe there is some php that the OP would like to have parsed but i don't know that and if there was then readfile would be the wrong choice because it would do just that, read the file and display php code that someome might not want the whole world to see.

          My point here is that there are many ways to print a file (file_get_contents?) and i'm not saying which is right or wrong. I just wanted to give a quick example of printing out a text file since that's what the OP said it was. When i saw the file linkinfo.txt i wasn't considering it would have php code embedded.

            Sorry, I just looked at the code in your post and assumed that the file was on a remote server since you were including something over HTTP.

              Guys, thanks for your suggestions.

              Below is the complete link of an example where the Linkman and Wordpress are located.

              You can have a look at Linkman script from http://www.phpjunkyard.com/php-link-manager.php

              Currently this is the location of my Wordpress.
              http://www.raymond.cc/blog/

              And this is the location of where I installed Linkman.
              http://www.raymond.cc/linkman/

              I want raymond.cc/blog/links page to echo/print out a text file from http://www.raymond.cc/linkman/linkinfo.txt

              I think this should be the original php file taken from linkman folder that echo/print out the linkinfo.txt

              <?php
              
              require "settings.php";
              require_once("header.txt");
              
              $lines = array ();
              $lines=file($settings['linkfile']);
              
              echo "<p class=\"linkman\">";
              
              foreach ($lines as $thisline)
              {
              $thisline=trim($thisline);
              if (!empty($thisline)) {
              list($name,$email,$title,$url,$recurl,$description)=explode($settings['delimiter'],$thisline);
              if ($settings['clean'] != 1) {$url="go.php?url=".$url;}
              echo "$title - $description<br>\n";
              }
              }
                Write a Reply...