We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25230
    • 4 Posts
    Trying to include a file that will show some forum posts, but i can’t find any way to make it work.

    include(’http://www.site.com/lib/external.php?action=active’);

    Find out why at PHP.net:
    "<?php

    /* This example assumes that www.example.com is configured to parse .php
    * files and not .txt files. Also, ’Works’ here means that the variables
    * $foo and $bar are available within the included file. */

    // Won’t work; file.txt wasn’t handled by www.example.com as PHP
    include ’http://www.example.com/file.txt?foo=1&bar=2’;

    // Won’t work; looks for a file named ’file.php?foo=1&bar=2’ on the
    // local filesystem.
    include ’file.php?foo=1&bar=2’;

    // Works.
    include ’http://www.example.com/file.php?foo=1&bar=2’;

    $foo = 1;
    $bar = 2;
    include ’file.txt’; // Works.
    include ’file.php’; // Works.

    ?> "

    Does anyone know how to fix this?

    //Robb.co uk
      • 25230
      • 4 Posts
      Thanks for the reply ganesh!

      I tested it but extern.php said i did not supplied any parameter?

      forum snippet:
      <?php
      include(’/url/forum/extern.php’);
      ?>

      In the template:
      [!forum? &action=`active`!]
        • 32942
        • 141 Posts
        I think ganes meant, that you should put the entire file into modx as snippet instead of including it.