关于在html5/css3,php& xaml [英] About embedding between html5/css3, php & xaml

查看:80
本文介绍了关于在html5/css3,php& xaml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我如何将xaml和html5/css3脚本嵌入到php脚本中吗???请为这两个问题分别提供解决方案...

xaml->进入-> php
html5/css3->进入-> php

改写问题:-
我在某处看到php可以像两种不同语言之间的胶水一样工作.
我认为这意味着您可以通过某些方式将任何其他语言添加到php脚本中(这就是我想知道的操作方法?).

所以现在你可以看到
1.我只想将一些xaml代码添加到php脚本中
2.我只想将一些html5/css3代码添加到php脚本中

所以请告诉我该怎么做!提前非常感谢您

can anyone tell me that how to embed a xaml & html5/css3 scripts into php script ....?? please give separate solution for both .....

xaml -> into -> php
html5/css3 -> into -> php

Rephrased Question :-
somewhere i saw that php can works like glue between two different languages.
i think that means u can add any other language into php script by some ways (that''s what i want to know how to do this?).

so now u can see that
1. i just want to add some of xaml codes into a php script
2. i just want to add some of html5/css3 codes into a php script

so please tell me how to do this.! very thankful to you in advance

推荐答案

这个问题没有什么意义.首先,您需要了解PHP或其他服务器端技术的工作方式.在PHP中并没有真正嵌入"的东西.

实际上,任何PHP文件都是某种模板,该模板应作为对某些HTTP请求的响应而生成的HTTP响应.因此,这是一个文本文件,其中包含PHP代码片段;使用定界符<php?>可以转义此类片段.选择这种语法是为了避免干扰HTML语法:定界符不能解释为HTML文本元素(因为HTML实体不会转义大号"和小号"括号),也不是有效的HTML标记.作为服务器端,PHP模块首先定位并解释PHP片段,它不会产生冲突.

实际上,PHP代码可以通过生成适当的HTTP标头来生成任何内容类型的资源,但是整个页面应该是PHP代码.

在带有URI的HTTP请求指向某个PHP页面(该HTTP服务器通过文件名或索引文件名识别HTTP服务器,查看该服务器的主机文件系统的某些目录的路径和内容)后,将装入PHP模块服务器解释所有PHP代码片段并执行它们;它会生成一些要插入代码片段所在位置的PHP文件内容的内容.对所有此类片段依次重复此操作.

如果您了解此机制,则可以生成任何可想见的内容.根据PHP文件所有片段的内容格式化的内容将在HTTP响应中发送给客户端.在服务器端未分析任何要发送的结果内容的有效性,而HTTP响应是按原样发送的.在客户端,内容由浏览器加载并根据HTTP头中接收的内容类型进行解释:呈现,JavaScipts加载,解释和执行,等等.

你有主意吗?您首先应将服务器端和客户端发生的情况分开.如果您还了解HTML的工作原理,那么您对CSS的疑问就可以理解为在HTML中如何工作.希望您知道或可以阅读.

对于XAML,它与PHP没有直接关系. XAML用于WPF和Silverlight,它们与PHP无关.关于XAML的唯一事情可以是一些用于读取和处理XAML文件的XAML库,该库只能用作客户端的内容,也可以像其他任何数据文件一样在服务器端进行处理.这是很有可能的,因为XAML是一个非常广泛的标准. XAML的一部分可以仅由浏览器直接通过插件理解的矢量图形格式使用.或者,此类图形可以完全在服务器端呈现为位图图形,并通过HTTP响应作为位图内容类型(例如JPEG或PNG)传递给客户端.

有关更多详细信息,请参见:
http://en.wikipedia.org/wiki/PHP [ http://en.wikipedia.org/wiki/PHP_syntax_and_semantics [ http://www.php.net/ [ ^ ].

另请参见:
http://en.wikipedia.org/wiki/HTTP [ http://en.wikipedia.org/wiki/HTTP_header [ http://en.wikipedia.org/wiki/HTTP_HEAD_request [
The question as it is makes little sense. First of all, you need to understand how PHP or other server-side technologies work. Nothing is really "embedded" in PHP.

Any PHP file is actually some kind of template of what should be generated as a HTTP response in response to some HTTP request. So, this is some text file with fragment of PHP code in it; such fragments are escaped using the delimiters <php and ?>. Such syntax is chosen to avoid interference with HTML syntax: the delimiters cannot be interpreted as HTML text elements (because "greater then" and "less then" brackets are not escaped with HTML entities), nor they are valid HTML tags. As the server side the PHP module first locates and interprets PHP fragments, it does not creates conflicts.

Actually, PHP code could generate a resource of any content type via generation of appropriate HTTP headers, but then the whole page should be the PHP code.

On HTTP request with URI pointing to some PHP page (which a HTTP server recognized by the file name or index file name, looking at the path and the content of some directory of the server''s host file system), the PHP module loaded by the server interprets all the PHP code fragment and executes them; its generates some content to be inserted in the PHP file content in the place where the code fragment was. This is repeated sequentially for all such fragments.

If you understand this mechanism, you can generate any thinkable content. The content formatted according to the content of all fragments of PHP file is sent in the HTTP response to the client. No analysis of validity of the resulting content to be sent is not analyzed on the server side — the HTTP response is sent as is. On the client side, the content is loaded by the browser and interpreted according to the content type received in the HTTP header: rendered, JavaScipts are loaded, interpreted and executed, and so on.

Are you getting the idea? You should first separate what happens on server and client side. If you also know how HTML works, your questions about CSS are reduced to understanding on how it works in HTML. I hope you know it, or can read about it.

As to XAML, it is not directly related to PHP. XAML is used in WPF and Silverlight which also have nothing to do with PHP. The only thing about XAML can be some XAML library for reading and processing XAML files, which can be use as the content on client side only or processed on server side as any other data file. This is quite possible, because XAML is an extremely wide standard. A part of XAML can be used just a vector graphic format understood by browsers directly of via plug-ins. Alternatively, such graphics can be rendered as bitmap graphics purely on the server side and delivered to the client side through HTTP response as a bitmap content type (such as JPEG or PNG).

For further detail, please see:
http://en.wikipedia.org/wiki/PHP[^],
http://en.wikipedia.org/wiki/PHP_syntax_and_semantics[^],
http://www.php.net/[^].

See also:
http://en.wikipedia.org/wiki/HTTP[^],
http://en.wikipedia.org/wiki/HTTP_header[^],
http://en.wikipedia.org/wiki/HTTP_HEAD_request[^].

—SA


这篇关于关于在html5/css3,php&amp; xaml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆