PHP beginners headache Title summary

Source: Internet
Author: User
[1] The get and post variables cannot be passed between pages. in the latest php version, the active global variables of the session are closed. Therefore, the variables submitted from the previous page must be applied ,, of course, you can also modify the active global variable to open (php. when ini is changed to [1], the get and post variables cannot be passed between pages. in the latest php version, the active global variables of the session are closed, so we need to get the submitted variables from the previous page and apply them to get them.
Of course, you can also modify the active global variable to open (php. ini is changed to register_globals = On). considering compatibility, it is better to be familiar with new writing methods.
[2] an error occurs when apache2 uses the get method to pass Chinese parameters under Win32.
Test. php? A = Hello & B = you
Passing parameters will cause an internal error.
Solution: 'Test. php? A = '. urlencode (hello).' & B = '. urlencode (you can also)
.............

[3] The session under win32 does not work normally
Php. ini Default session. save_path =/tmp
This is obviously a configuration in linux. In win32, php cannot read or write session files, and thus the session cannot be applied.
Change it to a correct path, such as session. save_path = c: windows emp
[4] displaying error messages
When php. when display_errors = On and error_reporting = E_ALL of ini, all errors and prompts are displayed. it is best to enable this function during debugging for error correction, if you use php to write errors, most of them are about undefined variables. A prompt is displayed before the variable value is assigned. the solution is to detect or block the variable.
For example, display (isset () echo or echo @
[5] Win32 mail () cannot send email
Sendmail configured in linux can be sent. In win32, you need to call the smtp server to send emails.
Php. ini SMTP = ip // ip address is an smtp server without verification (it is hard to find it online)
The best solution for sending emails in php is to directly send emails to the recipient's email server using socket instead of forwarding the server.
[6] The newly installed mysql should be applied if no password is set
Update mysql. user set password = 'yourpassword' where user = 'root'
Change password
[7] header already sent
This error is usually displayed when you apply the HEADER. it may be due to several reasons: 1. you have PRING or ECHO before the application HEADER. 2. you have a blank line before the current file. 3. you may INCLUDE a file. this error may also occur if there are blank lines at the end of the file or the output .!
[8] php. ini has not been changed.
Restart the web server, such as IIS and Apache, and then use the latest settings.
[9] install php on 2003 (for how to install ISAPI, please advise)
Php4isapi. dll of PHP4 seems to be in conflict with 2003. it can only be installed in CGI mode.
Step 1: First install php-4.2.3-installer.exein www.php.net. you can also find the latest version. before installing php-4.2.3-installer.exe, ensure that your IIS6.0 is started and can be visited. After installation, go to the default website --> use program configuration
Step 2: Click "expand web Service"> "expand new web service.
Step 3: expand the name --> php, and then add
Step 4: Find the php.exe path and add it.
Step 5: confirm it!
Step 6: Select "expand php service" and click "agree.
[10]
Sometimes SQL statements do not work, and database control fails.
The simplest debugging method is echo the SQL statement to see if the variable value can be obtained
[11] Differences between include and require

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.