Re: templates
| From: | Ernest E Vogelsinger | Date: | Tue, 19 Nov 2002 17:17:50 +0000 |
| Subject: | Re: templates | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125123@lists.php.net to get a copy of this message | ||
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/