Day 101: PHP Requests

Dan Esmail - 4/11/2023

Intro

As I have been working on the website, something has always been bothering me. Why do I need to route everything with an HTML tag behind it? I know that there is a way to route your website to have slashes and a better file structure PHP requests and routes sound like it's the answer to my problem.

HTTP Request

From what I learned The first thing is that you'll need to work with routing and create a switch. This will be in an index PHP file. The switch will look at the Request_URI. From this point it will be able to look at any file you have in a views folder. Which we will get to a little later.

.htaccess

You might have to alter some code within the htaccess file to get the routing system working the way that you want it to work. I still need to test this out. it‘s somewhat hidden within Hostinger.

Views

You might have to alter some code within the htaccess file to get the routing system working the way that you want it to work. I still need to test this out. it‘s somewhat hidden within Hostinger.

Views

Once you have your request and routes set up you will be able to set up a folder with all the views in it. From here you will put in PHP files that have HTML code within them. These will be the files that run the show. They will be what the routes direct to and what shows up in the browser.



Day 1

Day 1