14 _php tutorials that make PHP beginners headache

Source: Internet
Author: User
Tags urlencode
Variable cannot be passed between "1" pages
Get,post,session Automatic global variables are turned off in the latest PHP version, so the variables to be submitted from the previous page are obtained using $_get[' foo '],$_post[' foo '],$_session[' foo '. Of course, you can also modify the auto global variable to ON (php.ini change to Register_globals
= on); For compatibility, it is better to force yourself to be familiar with the new wording.
"2" Win32 apache2 error when passing the Chinese parameter with the Get method:
test.php?a= Hello &b= You
Passing parameters can cause an internal error
 
Workaround: "Test.php?a=". UrlEncode (Hello). " &b= ". UrlEncode (you're good too)
.............
The session under "3" Win32 does not work properly
php.ini default Session.save_path =/tmp
This is obviously the configuration under Linux, Win32 PHP can not read and write the session file caused by the session can not be used, change it to an absolute path, such as Session.save_path
= c:windows EMP
"4" Displays error message
When PHP.ini's display_errors = on and error_reporting =
E_all, all errors and hints will be displayed when debugging, preferably open for error correction, if you use the previous PHP notation, most of the wrong information is about undefined variables. Variables are called before they are assigned, and the solution is to detect or block.
For example, $foo can be displayed, if (Isset ($foo)) echo $foo or echo @ $foo
"5" Win32 Mail () cannot send email
SendMail configured under Linux can be sent, in Win32 need to call the SMTP server to send e-mail, modify the php.ini SMTP = IP
IP is an SMTP server without authentication (hard to find online)
PHP the best way to send mail is to send the socket directly to the other email server instead of forwarding the server.
"6" first installed MySQL if you do not have a password set, you should use the update mysql.user set password= "YourPassword" where
User= "root" to change the password
"7" header already sent
This error usually occurs when you use the header, he may be several reasons: 1, you use the header before the Pring or Echo 2. You have a blank line 3 in front of your current file. You may include a file with a blank line at the end of the file or an output that will also cause this error.

"8" does not change after changing php.ini
Restart the Web server, such as Iis,apache and so on, before the latest settings are applied.
"9" PHP is installed on 2003 (ISAPI installation method Request Master advice)
PHP4 's php4isapi.dll seems to be in conflict with 2003 and can only be installed in CGI mode.

http://www.bkjia.com/PHPjc/629501.html www.bkjia.com true http://www.bkjia.com/PHPjc/629501.html techarticle A variable cannot be passed between the "1" page get,post,session in the latest PHP version, the auto global variable is closed, so the variable to be submitted from the previous page is to use the $_get[' fo ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.