Thanks, but not sure if this is what i'm looking for....

I just want to setup the PHP script so that the variable $filename can be changed via 
a link such as 'index.php?filename="file.xml"',
causing the script to parse the appropriate file.

Adam.
  ----- Original Message ----- 
  From: Ernest E Vogelsinger 
  To: Adam 
  Cc: Jonathan Sharp ; [EMAIL PROTECTED] 
  Sent: Tuesday, November 19, 2002 5:17 PM
  Subject: Re: [PHP] templates


  At 18:04 19.11.2002, Adam spoke out and said:
  --------------------[snip]--------------------
  >Cheers for replying.
  >
  >I have the menu in place already, it is the PHP end i'm not sure about.
  >Currently I have many php files which only differ in one line:
  >$filename="file.xml";
  >
  >I want to be able to pass this value to the script through a link.
  --------------------[snip]-------------------- 

  How about
      $files = array('file1.xml' => 'Go to file 1',
                     'file2.xml' => 'Go to file 2',
                     'file3.xml' => 'Go to file 3',
                     'file4.xml' => 'Go to file 4');
      foreach ($files as $filename => $text) {
          // you should put your actual menu code here
          echo '<a href="', $_SERVER['PHP_SELF'], '?filename=',
               urlencode($filename), '">', htmlentities($text), '</a><br>';
      }


  -- 
     >O Ernest E. Vogelsinger 
     (\) ICQ #13394035 
      ^ http://www.vogelsinger.at/


Reply via email to