NYCPHP Meetup

NYPHP.org

[nycphp-talk] <script language="php">

Jim Musil jim at nettmedia.com
Thu Feb 6 14:13:42 EST 2003


I know that the following works:

<script language="Javascript" src="foo.php" arg1="bar" />

Then PHP outputs custom javascript...

Jim


On 2/6/03 2:05 PM, "Chris Snyder" <chris at psydeshow.org> wrote:

> Jon Baer wrote:
> 
>> A small but annoying thing, I have been using this convention for a while
>> but always wonder why you really couldn't use it for header() since it is
>> your first code to pass through:
>> 
>> ie:
>> 
>> <script language="php">
>>    header("Location: file.php");
>> </script>
>> 
>> It is so much cleaner but I get the feeling it's not really acceptable ...
>> (this is coming from someone with JSP exp), in fact is it possible to write
>> parsing for a custom tag?
>> 
>> <script language="php" src="foo.php" arg1="bar"/>
>> 
>> Sorry for off the wall question :-)
>> 
>> - Jon
>> 
>>  
>> 
> Wow, does this work?
> I've always used PHP to format output into Javascript, and included it
> in the page that way:
> 
>   <script type='text/javascript' src='foo.php?format=js&arg=bar'></script>
> 
> foo.php would return something like this when called with $format==js :
> 
>    document.writeln('Hello. Arg equals bar.');
> 
> It would be fun to see this work the way you imply, though, with PHP
> outputting HTML as a client-side include. Never tried it.
> 
>   chris.
> 
> 
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 




More information about the talk mailing list