TAILIEUCHUNG - Professional Information Technology-Programming Book part 61

Tham khảo tài liệu 'professional information technology-programming book part 61', 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ả | Your First Script Before you go any further you need to make sure you can create and run PHP scripts as you go through the examples in this book. This could be on your own machine and you can find instructions for installing PHP in Appendix A Installing PHP. Also many web hosting companies include PHP in their packages and you may already have access to a suitable piece of web space. Go ahead and create a new file called time . php that contains Listing in a location that can be accessed by a PHP-enabled web server. This is a slight variation on the date example shown previously. Listing . Displaying the System Date and Time The time is php echo date H i s and the date is php echo date j F Y When you enter the URL to this file in your web browser you should see the current date and time according to the system clock on your web server displayed. Running PHP Locally If you are running PHP from your local PC PHP code in a script will be executed only if it is accessed through a web server that has the PHP module enabled. If you open a local script directly in the web browserfor instance by double-clicking or dragging and dropping the file into the browserit will be treated as HTML only. Web Document Location If you were using a default Apache installation in Windows you would create time . php in the folder C Program Files Apache Group Apache htdocs and the correct URL would be http localhost . If you entered Listing exactly as shown you might notice that the actual output produced could be formatted a little betterthere is no space between the time and the word and. Any line in a script that only contains code inside PHP tags will not take up a line of output in the generated HTML. If you use the View Source option in your web browser you can see the exact output produced by your script which should look similar to the following The time is 15 33 09and the date is 13 October 2004 If you insert a space character after that line now contains non-PHP

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.