Re: templates
| From: | Adam | Date: | Tue, 19 Nov 2002 17:04:33 +0000 |
| Subject: | Re: templates | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125115@lists.php.net to get a copy of this message | ||
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.
A.
----- Original Message -----
From: "Jonathan Sharp" <js-lists@sharpmedia.net>
To: "Adam" <adam@runtime-records.com>; <php-general@lists.php.net>
Sent: Tuesday, November 19, 2002 4:33 PM
Subject: Re: [PHP] templates
> I'm assuming you're trying to have a select list.
>
> Try this:
>
> <select name="foo"
> onChange="window.location='<?=$PHP_SELF?>?action=load&file=' +
this.value">
> <option value="file.xml">File XML1</option>
> <option value="file2.xml">File foo</option>
> </select>
>
> Just make sure you test the value you get for file, so that someone
> doesn't pass you /etc/passwd (just an example).
>
> -js
>
>
> Adam wrote:
> > I am developing a site, using XML and PHP for formatting. I want to have
one HTML template and call up the different XML files from a Javascript
menu.
> > Ideally i want to be able to call files from a link, such as:
> > 'index.php?action=load&file="file.xml"'
> >
> > Not sure if this is the right format, but hopefully you get the idea.
> >
> > Cheers,
> > Adam.
> >
>
>
>