cvs: phpdoc-zh /faq html.xml
| From: | Dallas Thunder | Date: | Sun, 20 Apr 2003 05:48:40 +0000 |
| Subject: | cvs: phpdoc-zh /faq html.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1347@lists.php.net to get a copy of this message | ||
dallas Sun Apr 20 01:48:40 2003 EDT
Modified files:
/phpdoc-zh/faq html.xml
Log:
Updated with 1.21
Index: phpdoc-zh/faq/html.xml
diff -u phpdoc-zh/faq/html.xml:1.4 phpdoc-zh/faq/html.xml:1.5
--- phpdoc-zh/faq/html.xml:1.4 Sat Feb 22 05:40:19 2003
+++ phpdoc-zh/faq/html.xml Sun Apr 20 01:48:40 2003
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- $Author: dallas $ -->
-<!-- EN-Revision:1.19 Maintainer: dallas Status: ready -->
+<!-- EN-Revision:1.21 Maintainer: dallas Status: ready -->
<chapter id="faq.html">
<title>PHP ºÍ HTML</title>
<titleabbrev>PHP ºÍ HTML</titleabbrev>
@@ -233,6 +233,51 @@
</para>
</answer>
</qandaentry>
+
+ <qandaentry id="faq.html.javascript-variable">
+ <question>
+ <para>
+ ÔõÑù´Ó Javascript ´«µÝÒ»¸ö±äÁ¿µ½ PHP£¿
+ </para>
+ </question>
+ <answer>
+ <para>
+ ÓÉÓÚ Javascript £¨Í¨³£Çé¿öÏ£©Êǿͻ§¶Ë¼¼Êõ£¬¶ø
+ PHP £¨Í¨³£Çé¿öÏ£©ÊÇ·þÎñÆ÷¶Ë¼¼Êõ£¬¶øÇÒ
+ HTTP
ÊÇÒ»ÖÖ¡°ÎÞ״̬¡±ÐÒ飬Òò´ËÁ½ÖÖÓïÑÔÖ®¼ä²»ÄÜÖ±½Ó¹²Ïí±äÁ¿¡£
+ </para>
+ <para>
+
µ«ÊÇ£¬ÓпÉÄÜÔÚ¶þÕßÖ®¼ä´«µÝ±äÁ¿¡£Ò»ÖÖʵÏֵķ½·¨ÊÇÓÃ
+ PHP Éú³É Javascript
´úÂ룬²¢ÈÃä¯ÀÀÆ÷×Ô¶¯Ë¢Ð£¬½«Ìض¨µÄ±äÁ¿´«µÝ»Ø
+ PHP ½Å±¾¡£ÒÔÏÂÀý×ÓÏÔʾÁËÈçºÎÕâÑù×ö -- ÈÃ
+ PHP
´úÂëÈ¡µÃÏÔʾÆÁÄ»µÄ¸ß¶ÈºÍ¿í¶È£¬Í¨³£Ö»ÄÜÔÚ¿Í»§¶ËÕâô×ö¡£
+ </para>
+ <para>
+ <programlisting>
+<![CDATA[
+<?php
+if (isset($_GET['width']) AND isset($_GET['height'])) {
+ // output the geometry variables
+ echo "Screen width is: ". $_GET['width'] ."<br />\n";
+ echo "Screen height is: ". $_GET['height'] ."<br />\n";
+} else {
+ // pass the geometry variables
+ // (preserve the original query string
+ // -- post variables will need to handled differently)
+
+ echo "<script language=\"javascript\">\n";
+ echo "
location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
+ . "&width=\" + screen.width + \"&height=\" +
screen.height;\n";
+ echo "</script>\n";
+ exit();
+}
+?>
+]]>
+ </programlisting>
+ </para>
+ </answer>
+ </qandaentry>
+
</qandaset>
</chapter>