$title .= "<? include(\"/download/browser.php?action=file&id=$file->file_id.html\");?>";

Thats what I have in a PHP script. Now I put $title where it should output but when I call the script the includes dont work but no error shows up. I also checked the source and the includes are in, and would work if it was an html file. Is there anyway I can add includes inside a script?

    includes don't do what you're trying to do.

    include 'someotherfile.php';

    means...don't just use the code in the current file, use the code from some other file, too.

    so an include like 'someotherfile.php?var=xxx' isn't going to do what you think.

    You could stuff the output of a php url into a variable by using file commands (like fopen, fread, etc.), if that's what you mean to do.

    Even then I'm not sure that $ variables in the url, like $file, will act the way you wish.

    I'd be glancing at the manual to unserstand the limits of those commands.

      Sorry I didn't explain it real well so you could understand me. Here look at this example..

      <?php

      while ($file = mysql_fetch_object($result)) {
      $date = date("n/j/y", $file->file_time);
      $ntv = $file->file_totalvotes - 1;
      if ($file->file_rating == 0 or $ntv == 0) { $rating = 0; } else {$rating = round($file->file_rating/$ntv, 2); }
      if ($file->file_posticon == "none" or $file->file_posticon == "none.gif") {
      $posticon = "&nbsp;";
      } else {
      $posticon = "<img src=\"images/posticons/$file->file_posticon\">";
      }

      $filelist .= "

      <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
      <tr>
      <td width=\"311\"><img src=\"/skins/$category[1]/$file->file_name.jpg\" alt=\"\" height=\"142\" width=\"300\" border=\"1\"></td>
      <td valign=\"top\">

      <? include 'http://aces.bf42.com/download/pafiledb.php?action=file&id=$file->file_id'; ?>

      <center><a href=\"/skins/$category[1]/$file->file_name.html\"><img src=\"/skins/info.jpg\" alt=\"\" height=\"24\" width=\"146\" border=\"0\"></a></center>
      </td>
      </tr>
      </table>";

      }

      Ok see the include in there?

      Ok I call it up

      <?php
      echo $filelist;
      ?>

      http://url.com/download/browser.php?action=category&id=5

      Now the page works blah blah except where the include is included the output it doesn't show up. No error or nothing just blank space...

      Hope that better explains my problem.

        Well, I've reread the manual and find yet again that I only THINK I know it all: include does provide for HTTP protocol calls, complete with GETS.

        I still don't think you've got a valid URL for include, however.

        Use of -> in your URL may be problematic: Browsers translate this automatically, but the include command doesn't. Consider using urlencode() function.

        It may be that the aces.bf42.com server has been set up in apache to block calls from remote servers. Lots of servers do this to prevent hotlinking, especially to dirty pictures. Even if you'r not hotlinking to dirty pictures, an global Apache set up like this would result in a blank space where you expected output.

        Another possiblity? Are you using windows PHP?

        From the manual:

        "Warning

        Windows versions of PHP prior to PHP 4.3 do not support accessing remote files via this function, even if allow_url_fopen is enabled.

        See also Remote files, fopen() and file() for related information. "

          Write a Reply...