📄 faq.using.html
字号:
<p class="para"> You can fix the problem either by unticking <i>Anonymous Access</i> and leaving <i>Integrated Window Authentication</i> ticked, or, by ticking <i>Anonymous Access</i> and editing the user as he may not have the access right. </p> </dd> </dl> <dl> <dt><strong> <p class="para"> My PHP script works on IE and Lynx, but on Netscape some of my output is missing. When I do a "View Source" I see the content in IE but not in Netscape. </p> </strong></dt> <dd><a name="faq.using.netscape"></a> <p class="para"> Netscape is more strict regarding HTML tags (such as tables) then IE. Running your HTML output through a HTML validator, such as <a href="http://validator.w3.org/" class="link external">» validator.w3.org</a>, might be helpful. For example, a missing </table> might cause this. </p> <p class="para"> Also, both IE and Lynx ignore any NULs (<i>\0</i>) in the HTML stream, Netscape does not. The best way to check for this is to compile the <a href="features.commandline.html" class="link">command line</a> version of PHP (also known as the CGI version) and run your script from the command line. In *nix, pipe it through <i>od -c</i> and look for any <i>\0</i> characters. If you are on Windows you need to find an editor or some other program that lets you look at binary files. When Netscape sees a NUL in a file it will typically not output anything else on that line whereas both IE and Lynx will. </p> </dd> </dl> <dl> <dt><strong> <p class="para"> How am I supposed to mix XML and PHP? It complains about my <?xml tags! </p> </strong></dt> <dd><a name="faq.using.mixml"></a> <p class="para"> In order to embed <?xml straight into your PHP code, you'll have to turn off short tags by having the PHP directive <a href="ini.core.html#ini.short-open-tag" class="link">short_open_tags</a> set to <i>0</i>. You cannot set this directive with <b> ini_set()</b>. Regardless of <a href="ini.core.html#ini.short-open-tag" class="link"> short_open_tags</a> being on or off, you can do something like: <i><?php echo '<?xml'; ?></i>. The default for this directive is on. </p> </dd> </dl> <dl> <dt><strong> <p class="para"> How can I use PHP with FrontPage or some other HTML editor that insists on moving my code around? </p> </strong></dt> <dd><a name="faq.using.editor"></a> <p class="para"> One of the easiest things to do is to enable using ASP tags in your PHP code. This allows you to use the ASP-style <% and %> code delimiters. Some of the popular HTML editors handle those more intelligently (for now). To enable the ASP-style tags, you need to set the <a href="ini.core.html#ini.asp-tags" class="link">asp_tags</a> <var class="filename">php.ini</var> variable, or use the appropriate Apache directive. </p> </dd> </dl> <dl> <dt><strong> <p class="para"> Where can I find a complete list of variables are available to me in PHP? </p> </strong></dt> <dd><a name="faq.using.variables"></a> <p class="para"> Read the manual page on <a href="language.variables.predefined.html" class="link"> predefined variables</a> as it includes a partial list of predefined variables available to your script. A complete list of available variables (and much more information) can be seen by calling the <a href="function.phpinfo.html" class="function">phpinfo()</a> function. Be sure to read the manual section on <a href="language.variables.external.html" class="link">variables from outside of PHP</a> as it describes common scenarios for external variables, like from a HTML form, a Cookie, and the URL. </p> <blockquote><p><b class="note">Note</b>: <b>register_globals: importantnote</b><br />As of PHP 4.2.0, the default value for the PHP directive<a href="ini.core.html#ini.register-globals" class="link">register_globals</a> is <em class="emphasis">off</em>, and it was completely removed as of PHP 6.0.0. The PHP communitydiscourages developers from relying on this directive, and encourages the useof other means, such as the <a href="language.variables.predefined.html" class="link">superglobals</a>.<br /></p></blockquote> </dd> </dl> <dl> <dt><strong> <p class="para"> How can I generate PDF files without using the non-free and commercial libraries like <a href="ref.pdf.html" class="link">PDFLib</a>? I'd like something that's free and doesn't require external PDF libraries. </p> </strong></dt> <dd><a name="faq.using.freepdf"></a> <p class="para"> There are a few alternatives written in PHP such as <a href="http://www.ros.co.nz/pdf/" class="link external">» http://www.ros.co.nz/pdf/</a>, <a href="http://www.fpdf.org/" class="link external">» http://www.fpdf.org/</a>, <a href="http://www.gnuvox.com/pdf4php/" class="link external">» http://www.gnuvox.com/pdf4php/</a>, and <a href="http://www.potentialtech.com/ppl.php" class="link external">» http://www.potentialtech.com/ppl.php</a>. There is also the <a href="http://www.stillhq.com/cgi-bin/getpage?area=panda" class="link external">» Panda</a> module. </p> </dd> </dl> <dl> <dt><strong> <p class="para"> I'm trying to access one of the standard CGI variables (such as $DOCUMENT_ROOT or $HTTP_REFERER) in a user-defined function, and it can't seem to find it. What's wrong? </p> </strong></dt> <dd><a name="faq.using.cgi-vars"></a> <p class="para"> It's important to realize that the PHP directive <a href="ini.core.html#ini.register-globals" class="link">register_globals</a> also affects server and environment variables. When register_globals = off (the default is off since PHP 4.2.0), <var class="varname">$DOCUMENT_ROOT</var> will not exist. Instead, use <var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER['DOCUMENT_ROOT'] </a></var>. If register_globals = on then the variables <var class="varname">$DOCUMENT_ROOT</var> and <var class="varname"><a href="reserved.variables.globals.html" class="classname">$GLOBALS['DOCUMENT_ROOT']</a></var> will also exist. </p> <p class="para"> If you're sure register_globals = on and wonder why <var class="varname">$DOCUMENT_ROOT</var> isn't available inside functions, it's because these are like any other variables and would require <i>global $DOCUMENT_ROOT</i> inside the function. See also the manual page on <a href="language.variables.scope.html" class="link">variable scope</a>. It's preferred to code with register_globals = off. </p> <blockquote><p><b class="note">Note</b>: <b>Superglobals: availability note</b><br />Superglobal arrays such as <var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET</a></var>,<var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var>, and <var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER</a></var>, etc. are availableas of PHP 4.1.0. For more information, read the manual section on<a href="language.variables.predefined.html" class="link">superglobals</a><br /></p></blockquote> </dd> </dl> <dl> <dt><strong> <p class="para"> A few PHP directives may also take on shorthand byte values, as opposed to only <a href="language.types.integer.html" class="type integer">integer</a> byte values. What are all the available shorthand byte options? And can I use these outside of <var class="filename">php.ini</var>? </p> </strong></dt> <dd><a name="faq.using.shorthandbytes"></a> <p class="para"> The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes; available since PHP 5.1.0), these are case insensitive. Anything else assumes bytes. <i>1M</i> equals one Megabyte or <i>1048576</i> bytes. <i>1K</i> equals one Kilobyte or <i>1024</i> bytes. You may not use these shorthand notations outside of <var class="filename">php.ini</var>, instead use an <a href="language.types.integer.html" class="type integer">integer</a> value of bytes. See the <a href="function.ini-get.html" class="function">ini_get()</a> documentation for an example on how to convert these values. </p> </dd> </dl> </div> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="faq.build.html">Build Problems</a></div> <div class="next" style="text-align: right; float: right;"><a href="faq.html.html">PHP and HTML</a></div> <div class="up"><a href="faq.html">FAQ</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -