200: HTML: Can Be Generated By A Web Server.
Take Up Code - En podcast af Take Up Code: build your own computer games, apps, and robotics with podcasts and live classes
Kategorier:
A modern website is more than just a collection of some HTML pages. If all you have is some basic information that you want to make available for the world to see, then you can create HTML files and put them in your website directory. You might have other files to put on the server too such as images and cascading style sheets. You can build a website like this and each time you add a new HTML file, you’ll have to link it into your website by finding an existing HTML file that you can modify to place a hyperlink to your new file. This is a lot of work and as your site gets bigger, the chances are greater that you’ll make a mistake and end up with broken links. These are links that no longer point to a valid file. If all you have is a few pages, then maybe this is all you need. But there’s two big problems with this type of website beyond just the extra work of trying to keep everything linked together. Both problems come back to the need to be able to offer different content to different visitors. That means the web server needs to be able to send different HTML files to different visitors. How do you do this? There’s nothing in HTML that allows this. Listen to the full episode or read the full transcript below for more information and how a language like PHP solves this by generating HTML for your website visitors. Transcript You can still build a website by connecting a server computer to the Internet with a fixed IP address and then running web server software on that computer. Most of the time, all this is done for you already when you sign up for web site hosting. All you have to do is place some HTML files in the directory provided for you. Or if you have more control over the server, you might need to do this part yourself and create the directories and configure the web server to start listening for requests. I’ll explain how this works in a future episode. For now, all you need to know is that the web server receives a request for a particular URL and knows where to find the files so it can return whatever was requested. If all you have is some basic information that you want to make available for the world to see, then you can create HTML files and put them in your website directory. You might have other files to put on the server too such as images and cascading style sheets. You can build a website like this and each time you add a new HTML file, you’ll have to link it into your website by finding an existing HTML file that you can modify to place a hyperlink to your new file. This is a lot of work and as your site gets bigger, the chances are greater that you’ll make a mistake and end up with broken links. These are links that no longer point to a valid file. If all you have is a few pages, then maybe this is all you need. But there’s two big problems with this type of website beyond just the extra work of trying to keep everything linked together. The first problem is this type of website offers the same content to every visitor. Maybe that’s okay for a restaurant website that just wants to post a menu online. Everybody can see the same menu. But it’s not going to work for an online banking website where each visitor expects to see account information specific to them. Or an online store where visitors want to interact with the store and buy things and expect to see a history of just the items they’ve bought. Anytime you want to let visitors view custom information, or create an account, or interact with other users, then a fixed set of HTML files will no longer work. The other problem is more for your convenience. Anytime you want to change or update your website, you don’t want to have to make changes to HTML files directly. And I’m not just talking about the difficulty of keeping everything linked together. You’ll either have to edit the HTML files directly on the server or edit them on your local computer and then upload the