I am fortunate enough to be engaged in php teaching. I have learned php comprehensively. After some time, I have provided some experiences and experiences to you so that more people can take less detours, if anything is incorrect, you are welcome to criticize and correct it. Thank you. Before learning php, you must have some knowledge to learn. That is, you must first learn static Web pages and learn static Web pages.
I am fortunate enough to be engaged in php teaching. I have learned php comprehensively. After some time, I have provided some experiences and experiences to you so that more people can take less detours, if anything is incorrect, you are welcome to criticize and correct it. Thank you. Before learning php, you must have some knowledge to learn. That is, you must first learn static Web pages and learn static Web pages.
I am fortunate enough to be engaged in php teaching. I have learned php comprehensively. After some time, I have provided some experiences and experiences to you so that more people can take less detours, if anything is incorrect, you are welcome to criticize and correct it. Thank you.
Before learning php, you must have some knowledge to learn. That is, you must first learn static Web pages. When learning static Web pages, you must master the usage of css and javascript, learning css mainly enables p + css to implement webpage layout and some common writing methods. topstyle is recommended for css editors. Javascript is more important. Learning javascript well is very helpful for ajax and jquery. In javascript, you can master the knowledge of javascript syntax, events, various built-in objects, object models, and dom, in fact, we use javascript to achieve the dynamic effect of web pages and form verification. We recommend the javascript Editor: 1st + JavaScript + Editor, which is very small, there are prompts and case code. You can also go to Youku to learn my HTML video.
With these foundations, it is much easier to learn php again. First, we need to build a php development environment before writing a program. Here we will introduce two methods:
1. easyphp + eclipsephp: website servers and database servers are required for website development. apache and iis can be used for website servers in php, and mysql is used for database servers, in the first method, easyphp integrates apache and mysql servers. You only need to install easyphp on two servers. In this case, you only need the ide editing tool, which uses eclipsephp, very convenient and easy to use.
2. apache + php5 + mysql5 + eclipsephp is used. In this method, you need to install the servers separately and perform various configurations. For details, you can search for them in Baidu or Google.
When the php development environment has been set up, we will learn it directly. We can follow these steps:
1. Make a case directly. The first case is form submission. In this case, two pages are required: a static html page, a form in the page, and a page for processing the form, knowledge points required for processing forms on the page, first from the simple start, directly output the form value, the knowledge points required to implement this function: 1. How to add php code to the php file, use 2. How to declare variables. php is weak and all variables start with the $ symbol. 3. If the value of the form is obtained, if the form is submitted through get, use $ _ GET ["Control name in Form"]. If it is submitted through POST, use $ _ POST ["Control name in Form"]. Here it involves array knowledge points, I have already figured out the php array. This array is different from the array in other languages and is organized by key-value pairs. $ a = array (, 4 ), the keyword of this array is a number, starting from 0, and the access through echo $ a [0]; The keyword of the array can also use a string, for example, $ a = array ("first" => 1, "2" => "www", "4" => "adfad"), in this form, the access to the array is in the form of echo $ a ["first"]. The array also involves two-dimensional arrays and various array functions. To master php, you must master php functions, php functions can be viewed through the php documentation. In the array, you must master the php array functions. 4. How to output the data: echo, printf, sprintf, and print_r. To find out the differences, echo is commonly used, which is highly efficient, for other functions, you can check the difference between the double quotation marks and single quotation marks in php. The double quotation marks can contain variables and output the variable values in the output, if there is a variable in single quotes, the variable will be output as a string.
After figuring out this case, I have mastered a lot of php knowledge. On the basis of this case, I will introduce a specific account and password. When it is entered correctly, I will jump to the homepage, if it is incorrect, you can jump to the error page. In this case, you need to use the knowledge point: page Jump implementation. There are two methods for page Jump. The first method is header ("location: address ");, can also be implemented using js code, but to add JavaScript code to php, sample code:
...........
If ($ name = "admin" & $ pwd = "88888 "){
?>