Learn PHP One months experience summary

Source: Internet
Author: User
Tags functions iis sql mysql net variables access zend
To date, the first PHP wrote the site is almost bright, noon backstage part of all the functions to complete means that later do other stations can be used, do not have to spend too much energy to write, now simple to write and learn PHP this one months I encountered the main problem.

Question 1: environmental collocation
PHP's most classic combination of course is lamp (linux+apache+mysql+php), but I do not have the conditions and energy to get Linux, so with Windows 2003 instead of Linux, debugging, and not to do the server, so do not require sufficient performance.

My machine is win2003+iis+framework environment can run ASP and. NET, and equipped with Jdk+tomcat+oracle also can run JSP, this is not going to destroy these environments and then install Apache and MySQL, but difficult ah.

Then give up the JSP environment, and backed up with ghost ASP environment, delete IIS after the installation of PHP environment, the environment is very good, in Baidu easy to find a tutorial on the installation can be apache+php+mysql+phpmyadmin, no installation Zend, After further study of the time to say it, no research to understand how many sites when there are different ways to run in different ports, but also regardless of, now 80 port run, the environment debugging good later back up a ghost, is a success of the PHP environment set up.

Issue 2: Page blank lines resulting from tagged BOM for utf-8 encoded files
This problem has been encountered before in the study of XHTML+CSS, That's because the document declaration type was preceded by a different code or no document declaration type xhtml1.0 is created using the standard of the web, at first I thought it was the require written in the document statement before the problem, and then repeatedly debugging found not so simple, and later on Baidu search a lot about require caused empty line The problem, there is a cow mentioned to be in the Dreamweaver inside Ctrl+j the Utf-8 encoded BOM removed, at that time also do not understand what the BOM is, said to remove it, really solve the problem, this is the past, but there are utf-8 problems, but also with this relationship.

On the value of checkbox under 3:php problem
This is the only place I find PHP inconvenient, unlike the ASP, all of the checkbox's value of the same name is stored in a set, PHP can only take the value of the last checkbox in the same name, in the Long data where in (AA,BB,CC,DD) query is inconvenient, Can only use js+ a hidden input method to achieve, although a little trouble, but not a big problem, it is easy to solve, the internet checked a bit also really only so can solve!

Problem 4:access Library go to MySQL issue
After all, the database has been designed, and it's also troublesome to build a table in phpMyAdmin. Simply find a software to directly transfer the library, but also good let me find the software, but the whole English interface, the name did not remember, tomorrow to see the company again sent up, the library is very easy to turn over, but my hands are cheap, See MySQL inside the Data folder with the same name as the database I built folder, I thought there would be no need for this folder to build a library inverted library, the rise of the useless are deleted, the problem of the phpMyAdmin not even on the library, this is a good solution, reload a MySQL problem solving, But I did not back up to change back to the ASP environment, and then change back when the MySQL out of the big problem, the reload is no use, on Baidu a god search, the final csdn of the cattle gave the answer "Libmysql.dll and Php5ts.dll test to System32", to solve the problem.

Problem 5:ntfs permission issue.
This problem ASP also appeared, but in the PHP environment is not a lot of heart to this point, so I have been a full morning, found that this problem is a friend of the server, the day before drinking just know a buddy encounter PHP build station problem, and then the wine I installed a, said I php many cattle cow ah, I learned 2 weeks, hahaha, the next day to give someone to solve the problem, the cattle are blown out also can not ignore others, connected to the server to see the original is installed PHPCMS encountered a MySQL problem installation can not continue, Baidu on a god search to find the problem is the issue of NTFS permissions, This is a good solution, add an Internet guest user to solve, estimated oneself will also encounter this problem, so early encounter than late encounter strong, the key time to know what happened!

Problem 6:cookies Read and write problem.
This question should not be a big problem, but the day immediately off, did not have time to solve, the next day very easy to do, just start learning affirmative statement master not much, thought $_cookie["xxx"] can read or write it, use here when found the Ministry of the road, the Internet casually a search " PHP Cookies Write "The answer comes, Setcookie can, really simple ah."

Problem 7:php paging.
With the ASP when the SQL statement also did not delve into, do not know limit this thing, I said before looking at Taobao, Baidu's paging on the 0 20, 20 20 of such parameters passed, are all dry pagination, a little supplement to the problem of SQL courses solved, the number of pages to judge where the principle is the same as the problem, green light to solve the battle!

Question 8: Create the Utf-8 file to write the Chinese garbled problem, question 2 follow-up questions.
It was done in the first place, just do not use the Chinese test, and then do have the Chinese place to find that there is no spirit, ah, the headache, this problem packed me for several days, has not been resolved, in order not to be bothered by this problem, so the first written in English to put this article passed, yesterday must be resolved here, So it's hard to get your scalp down. Or BOM signature problem, the following are for my own understanding, do not know right, Windows environment recognition UTF-8 and ANSI file is UTF-8 file before a document called BOM signature, this thing ordinary text editor is invisible Xef XBF Xee is like these three 16 characters, anyway is three things, the problem 2 Li is also their three out of the whole, UTF-8 in Windows although to use these three guys to distinguish, in PHP does not use things, or the problem 2 inside why to remove the BOM signature it, Blame it on me when I was doing ASP encountered the same UTF-8 file written in Chinese garbled problem, so left a heart, first on the Internet a UTF-8 file in PHP write function, inside the three nasty things added in, ah I go, this is smart wrong, this is not a debugging , then I also suddenly realized that the three guys removed, the problem solved, that carefree ah.

There are a lot of small problems, such as the escape character is Chr (36) Ah, the keyword in the SQL from AH (in the ASP is not a keyword), the use of time functions (giant convenient, more comfortable than the ASP).

After nearly one months of learning to find that PHP is really strong, and very studious, provided that there is a Web server-side language base, feel that there are a lot of ASP needs to focus on the problem in PHP is not a problem, all for you think well, and PHP fast, I can feel a lot faster than asp+access without using Zend. JSP and. NET can not be compared at all speed, the code is very simple, in addition to the checkbox I said a little trouble, other local code is more concise than the ASP, many places are very flexible, such as the definition of variables, $ The variable at the beginning makes the name a lot less restrictive, a lot of strings and variables to be used to connect the use of the place because there is a $ exists without hyphens, because the $ represents variables, so do not have to emphasize, in short PHP is very good very powerful, really good for the site.

The next step is to learn the syntax of the sentence at the same time, to strengthen their own object-oriented thinking, the real strength of PHP is still in the back!

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.