TAILIEUCHUNG - PHP Developer's Dictionary- P12

PHP Developer's Dictionary- P12:PHP is an open source, server-side, HTML-embedded scripting language used to create dynamically generated Web pages. With an easy-to-use syntax and a large, extensible library of modules, PHP brings together the best of Perl, C++, and other languages. | PHP Developer s Dictionary value echo CPhone br Fax br input type Text name Fax align LEFT required Yes size 25 value echo CFax br Email br input type Text name Email align LEFT required Yes size 59 value echo CEmail br input type Submit name Submit value Submit align MIDDLE form body html This script s first task is to determine through the CID which record is to be edited. This is done with a simple select query. The result set of this query is placed into variables to be used later in the HTML form. Notice that because only one record is to be returned we do not need to use a while loop and an array to return multiple records. The returned variables are placed into the HTML input tag as the value of the field. This places the information in the input field and enables the end user to edit the information. After the Submit button is pressed the second part of this script performs the update query. The form variables are passed to this script and are used to create the update query that is sent to the database. html head title Edit Record title conn pg_Connect localhost 5432 test if conn echo An database connection error occurred. n exit result pg_Exec conn UPDATE contacts SET name FullName address Address city City state State zip Zip phone Phone fax Fax email Email WHERE cid ID if result echo An UPDATE query error occurred. n exit result pg_Exec conn SELECT cid name address city state zip phone fax email FROM contacts WHERE cid ID if result echo A query error occurred. n exit CID pg_Result result i cid CName pg_Result result i name CAddress pg_Result result i address CCity pg_Result result i city CState pg_Result result i state CZip pg_Result result i zip CPhone pg_Result result i phone CFax pg_Result result i fax CEmail pg_Result result i email pg_FreeResult result pg_Close conn head body b The information has been changed to b br Full Name Last First MI br IT-SC book 55 PHP Developer s Dictionary b echo CName b br Address br b echo CAddress b br City br b echo

Đã 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.