PHP 5/MySQL Programming- P54

PHP 5/MySQL Programming- P54:computer programming has often been seen as a difficult and arcane skill. Programming languages are difficult and complicated, out of the typical person’s reach. However, the advent of the World Wide Web has changed that to some extent. It’s reasonably easy to build and post a Web page for the entire world to see. The language of the Web is reasonably simple, and numerous applications are available to assist in the preparation of static pages | 243 numArray array 1 ichii 2 nii 3 san 4 shi s- select options numArray s- h3 make form elements inside a table myArray array array s- gTag b name s- gTextbox name array s- gAddText address s- gTextbox address array s- gAddText phone s- gTextbox phone array s- gAddText favorite number s- gSelect number numArray s- buildTable myArray s- submit s- addText form n s- h3 results from previous form if any s- formResults s- buildBottom print s- getPage Chapter 7 Writing Programs with Objects Building a Simple Form and Adding a Text Box The following code snippet builds the most basic SuperHTML form s- addText form s- textbox userName Joe s- submit s- addText form I used the addText method to provide the basic form tags and then created a textbox and submit button using the SuperHTML object s special methods. 244 PHP 5 MySQL Programming for the Absolute Beginner You might be surprised that I don t have special methods to begin and end the form. They would be easy but I felt they wouldn t simplify things much so I just used the addText method to add form tags. Of course you are free to add these methods yourself if you wish. The SuperHTML project is designed as a framework only and I m eager to see people add new functionality to it. The textbox method can take one or two parameters. The first parameter is the name of the resulting input element. The second optional parameter is the element s default value. If you do not specify a value it is left blank. Of course the submit button resolves to almost the same kind of HTML code and it works very much like the textbox. However if you leave off the submit method s second parameter your HTML code will show the typical Submit Query caption. Building Drop-Down Menus There are a number of times you ll want the user to choose input from a limited number of options. Often the value you want to send to the next program isn t exactly what the user sees. The appropriate HTML device for this situation is the select element with a bunch

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
39    77    1    20-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.