|
||
|
└>Tutorial Lesson 1: Embedding PHP Introduction: Before you can do anything with PHP you need to know where to put it! PHP can be placed directly into any html document, however, when you save the file it must be saved with the .php extension, Step 1: Create a new blank HTML page. For the first lesson you need to create a blank html page (with all the required html tags, <html>,<body>, etc... ). php code can go anywhere in the document, but must be enclosed by: <?php ?> , but for this lesson we will be placing the code inside the body tag as seen in Step 2. Step 2: Insert the PHP embed tag. Place the php embed tag inside the <body> tag of your blank html file:
Step 3: Insert some PHP code. Insert your php code, since this is the first lesson we will use the PHP print command to display the words "Hello World!" in the browser.
Step 4: Save the file and test it out. Save your first php program as hello.php and upload it to your web host (your host must be able to run php! Most these days do.). Now load it in your web browser and you should see the words "Hello World!" show up! You can see it in action here. Dont stop now, continue on to Lesson 2 - How to use Variables! |
||||||||
