tailieunhanh - PHP and MySQL by Example- P5
Tham khảo tài liệu 'php and mysql by example- p5', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Explanation 1 The HTML form is started here. Its action calls the script . 2 The PHP script is started here. It will process the form input. 3 If the form has been submitted the value _P0ST submit will be set. 4 The _post array contains the text that the user typed in the text area box named story. See Chapter 10 More on PHP Forms for more information on the _post array. For now input contains the input typed by the user. See Figure . 5 The stripslashes function removes the slashes that were added by addslashes the default behavior when the magic_quotes_gpc directive has been turned on in the file. Figure . The user fills in a form. Please purchase PDF Split-Merge on to remove this watermark. Figure . After the form in Figure is submitted. Output of Example . . Working with HTML Special Characters Like all languages HTML has certain characters that have special significance and those characters are represented by HTML entities special symbols starting with an ampersand and terminated with a semicolon for example the and symbols are written as lt and gt . If the user enters text that contains these HTML characters see Table when filling out a form you can use the htmlspecialchars function to convert the most common special characters to their respective HTML entities. If you require all HTML character entities to be translated use htmlentities shown in the next section. Table . HTML Special Character Functions Function What It Does htmlspecialchars_decode Converts special HTML entities back to characters htmlspecialchars Converts special characters to HTML entities The htmlspecialchars Function The htmlspecialchars function converts special characters shown in Table to HTML entities. Please purchase PDF Split-Merge on to remove this watermark. Table . Conversion of Special Characters Character Before The HTML Entity ampersand amp double quote quot when ent_noquotes is not .
đang nạp các trang xem trước