|
Posted by Tyrone Slothrop on 10/17/06 03:19
On 16 Oct 2006 19:41:14 -0700, "Bryan" <BTRichardson@gmail.com> wrote:
>Hello all,
>
>In some html code I have the following:
>
><script type='text/javascript' src='foo.js'></script>
>
>However, I'd like to replace 'foo.js' with something like
>"bar.php?file=foo" and have bar.php echo foo.js back to the script
>element. Is this possible?
First, a query string will not work with an include, like:
<? include('bar.php?file=foo'); }
However, you can create a function:
function foo($file)
{
include ('$file.js');
}
<?=foo('foo')?>
Also review file_get_contents() and readfile().
Navigation:
[Reply to this message]
|