[vox-tech] reading files into a web page

nbs vox-tech@lists.lugod.org
Sun, 3 Feb 2002 02:02:07 -0800


On Sat, Feb 02, 2002 at 11:49:53PM -0800, Peter Jay Salzman wrote:
> what's php translation?   like expansion of "variables" in case the file
> has something that may look like a php variable?

No, the entire 'include()'ed file is parsed for PHP.

So, you can have your main PHP page do this:

  Hello <? echo $name; ?>!<p>
  <? include("stuff.php"); ?>
  Goodbye!<p>


And then "stuff.php" could be something like:

  So tell me,
  <? if ($gender == "Male")
     {
       echo "Mr.";
     }
     else
     {
       echo "Mrs/Ms.";
     }
  ?>

  <? echo $name; ?>, what do you think of my website!?<p>



-bill!