Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
An introductory example of how to build a simple and minimal website built with PHP.
banago/simple-php-website
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
The site is now resposnive for mobiles Fixes and PHP notice for query strings Docs update to add running the site on PHP local server
Git stats
Files
Failed to load latest commit information.
readme.md
I put together this project while introducing a friend of mine to PHP. I decided to clean it up a bit and put it on Github so anyone new to PHP can have a taste of a very simple and minimal website built with PHP.
This project is meant for beginners. I’ve intentionally kept it minimal while introducing some separation of concerns.
There are only two steps to run this website:
- Download the project to the desired directory on your computer
- Run php -S localhost:8080 on your terminal. Navigate to http://localhost:8080 to see the site.
By defaut, the page URLs use query strings (?page=about). You need to have Apache installed for pretly URLs (/about) to work. To activate pretty urls, update config value of pretty_uri to true .
The project covers these programming concepts:
- Variables
- Arrays
- Functions
- Pretty links (/about) with fallback to query string (?page=about)
- Basic example of separation of concerns (functionality, template, content)
If you have any questions or recommendations for the project, please create an issue or hit me up on Twitter @banago.
To help you take your knowledge of PHP to the next level, I’ve personally hunt down what I deem to be the best introductory course on PHP out there. I wish this course existed when I started learing PHP. Check it out on Udemy: PHP for Beginners Course.