svn: /phpdoc/en/trunk/faq/ using.xml

From: Date: Fri, 02 Oct 2009 21:32:06 +0000
Subject: svn: /phpdoc/en/trunk/faq/ using.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-5044@lists.php.net to get a copy of this message
philip Fri, 02 Oct 2009 21:32:06 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=289109 Log: Removed a couple of old FAQs, and updated the *slashes() ones. Changed paths: U phpdoc/en/trunk/faq/using.xml Modified: phpdoc/en/trunk/faq/using.xml =================================================================== --- phpdoc/en/trunk/faq/using.xml 2009-10-02 21:24:46 UTC (rev 289108) +++ phpdoc/en/trunk/faq/using.xml 2009-10-02 21:32:06 UTC (rev 289109) @@ -69,9 +69,13 @@ </question> <answer> <para> - The function <function>addslashes</function> will do this. See - also <function>mysql_escape_string</function>. You may also - strip backslashes with <function>stripslashes</function>. + Assuming this is for a database, use the escaping mechanism that + comes with the database. For example, use + <function>mysql_real_escape_string</function> with MySQL and + <function>pg_escape_string</function> with PostgreSQL. There is + also the generic <function>addslashes</function> and + <function>stripslashes</function> functions, that are more + common with older PHP code. </para> &note.magicquotes.gpc; @@ -88,10 +92,11 @@ </question> <answer> <para> - The PHP function <function>stripslashes</function> will strip those - backslashes from your <type>string</type>. Most likely the backslashes - magically exist because the PHP directive + Most likely the backslashes magically exist because the PHP directive <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> is on. + This is an old feature of PHP, and should be disabled and not relied + upon. Also, the PHP function <function>stripslashes</function> may be + used to strip the backslashes from the <type>string</type>. </para> &note.magicquotes.gpc; @@ -322,35 +327,6 @@ </answer> </qandaentry> - <qandaentry xml:id="faq.using.netscape"> - <question> - <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. - </para> - </question> - <answer> - <para> - Netscape is more strict regarding HTML tags (such as tables) then - IE. Running your HTML output through a HTML validator, such as - <link xlink:href="&url.w3.validator;">validator.w3.org</link>, might - be helpful. For example, a missing &lt;/table&gt; might cause this. - </para> - <para> - Also, both IE and Lynx ignore any NULs (<literal>\0</literal>) in - the HTML stream, Netscape does not. The best way to check for this is - to compile the <link linkend="features.commandline">command line</link> version of - PHP (also known as the CGI version) and run your script from the - command line. In *nix, pipe it through <literal>od -c</literal> and look - for any <literal>\0</literal> 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. - </para> - </answer> - </qandaentry> - <qandaentry xml:id="faq.using.mixml"> <question> <para> @@ -372,26 +348,6 @@ </answer> </qandaentry> - <qandaentry xml:id="faq.using.editor"> - <question> - <para> - How can I use PHP with FrontPage or some other HTML editor - that insists on moving my code around? - </para> - </question> - <answer> - <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 &lt;% and %&gt; 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 <link linkend="ini.asp-tags">asp_tags</link> - &php.ini; variable, or use the - appropriate Apache directive. - </para> - </answer> - </qandaentry> - <qandaentry xml:id="faq.using.variables"> <question> <para>

« previous php.doc.cvs (#5044) next »