From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
How to use PHP in a web page - PHP Tutorial
From the course: PHP for Web Designers
How to use PHP in a web page
The web server needs to process any PHP code before it sends the page to the browser. But it won't do that unless you tell it to do so. You do that by giving your web pages the file name extension .php, instead of .htm or .html. Let's create a simple page. I'm in Dreamweaver, and in the welcome screen, there's actually an option for create a page, PHP page. If I click that, you'll see that I get an ordinary web page, complete with doctype and an HTML skeleton. Now what I'm going to do is, I'm going to Save this page. In my exercises folder as embed. And then .php. That PHP filename extension is simply an instruction to the server. It doesn't make any difference the way you build the HTML structure. All the CSS in your web pages. So let's add some HTML and some PHP to this page. First we need to give it a title, so change that Untitled Document to Embedding PHP in HTML. And in the body of the page. Let's have top-level heading, an h1, and we'll just say, This is Plain HTML. And, a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
How PHP makes web pages dynamic5m 23s
-
(Locked)
How to use PHP in a web page6m 43s
-
(Locked)
Using variables to store information2m 52s
-
(Locked)
Storing numbers and text in variables5m 18s
-
(Locked)
Displaying the values of number and text variables8m 9s
-
(Locked)
Using functions to manipulate values4m 36s
-
(Locked)
Adding comments to PHP scripts4m 46s
-
-
-
-
-
-
-
-