Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day
ptg16476052 656 LESSON 24: Taking Advantage of the Server One thing you should notice here is that you don’t have to indicate wh ...
ptg16476052 The PHP Language 657 24 1, and the index of blue is 2. You can reference an element of an array using its index, lik ...
ptg16476052 658 LESSON 24: Taking Advantage of the Server The element with the index specified will be removed, and the array wi ...
ptg16476052 The PHP Language 659 24 In this case, I have an associative array that has two elements. The values for each of the ...
ptg16476052 660 LESSON 24: Taking Advantage of the Server newline, and \r is the substitute for a carriage return. If you want t ...
ptg16476052 The PHP Language 661 24 string and does not terminate it. The other option is to use single quotes and employ the st ...
ptg16476052 662 LESSON 24: Taking Advantage of the Server PHP Conditional Operators It’s hard to write conditional statements if ...
ptg16476052 Loops 663 24 condition of some kind is satisfied. PHP supports several types of loops: do...while, while, for, and f ...
ptg16476052 664 LESSON 24: Taking Advantage of the Server for Loops Use for loops when you want to run a loop a specific number ...
ptg16476052 Loops 665 24 while loop will stop running. A do...while loop is basically the same, except the condi- tion appears a ...
ptg16476052 666 LESSON 24: Taking Advantage of the Server In this case, if the color is not the one I’m looking for, the continu ...
ptg16476052 User-Defined Functions 667 24 The preceding function has one argument, $arg. In this example, I’ve set a default val ...
ptg16476052 668 LESSON 24: Taking Advantage of the Server } $new_array = makeArray('one', 'two'); Your function can also return ...
ptg16476052 Processing Forms 669 24 Once you have access to the data the user submitted, you can do whatever you like with it. Y ...
ptg16476052 670 LESSON 24: Taking Advantage of the Server ▼ than a regular variable. Unfortunately, you have to give PHP a hint ...
ptg16476052 Processing Forms 671 24 <p>Please fill out the form below to register for our site. Fields with bold labels ar ...
ptg16476052 672 LESSON 24: Taking Advantage of the Server the form using a built-in PHP variable that returns the URL for the pa ...
ptg16476052 Processing Forms 673 24 Then I wrote the PHP to validate my fields: if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ( ...
ptg16476052 674 LESSON 24: Taking Advantage of the Server I use the is_numerical() function to check if the $agecheck variable ( ...
ptg16476052 Processing Forms 675 24 If there are errors, I want to load the form and show the errors inline. This is the easiest ...
«
30
31
32
33
34
35
36
37
38
39
»
Free download pdf