Your second script, as did the first, will generate the traditional "Hello, World!" greeting. However, this time you will use a combination of PHP along with HTML. Follow the simple steps below.
Type
cdto get to your home directory.
Type
cd public_htmlto descend into your web pages directory.
Create a new file called hello_world.php.
Type in the following lines:
<!-- helloworld.php This file illustrates how to embed PHP code inside HTML --> <html> <head> <title>PHP inside HTML: Hello World</title> </head> <body> <?php echo "<h1 align=\"center\">The Hello World Program Output</h1>\n"; // Print the message echo "<p>Hello, World!\n"; ?> <body> <html>
In your favorite web browser, type
http://localhost/~YOURID/helloworld.phpwhere YOURID is the user ID you have on the system.