ReePrime China
Beginner PHP Tutorial - 4 - Creating Your First PHP File

此内容来自第三方平台 (Dailymotion)。如果此视频侵犯了您的版权,请使用 立即删除 工具。

Beginner PHP Tutorial - 4 - Creating Your First PHP File

81 次观看 06:31 Videos

描述

Example: Hello World!
Start by making an ordinary HTML document, but name the file page.php and save it in the root of the site:
If you use XAMPP (see lesson 2), the path for the root is "c:\xampp\htdocs\page.php" on your computer (which is now a server). Read more abot saving PHP files in XAMPP.
If you have a website on a host that supports PHP, you simply upload/ftp the file to your web host.
The HTML code should look like this:




My first PHP page









As you probably remember from lesson 1, PHP is all about writing commands to a server. So let's write a command to the server.

First, we need to tell the server when the PHP will start and end. In PHP you use the tags to mark the start and end for the PHP codes that the server must execute (on most servers it will be suficient to use just

My first PHP page



Hello World!";

?>



When we look at the PHP document in a browser, it should look like this: