-
Book Overview & Buying
-
Table Of Contents
CouchDB and PHP Web Development Beginner's Guide
By :
The main attraction of any social network is a user's profile; the user profile usually displays the basic information of a user and shows any content that they have created.
By the end of this section, our user profiles will work as follows:
If a visitor goes to http://localhost/verge/user/johndoe, our routing system will match it with the route /user/:username
The index.php file will take johndoe as the value for username, and pass it to the User class in an attempt to find the user document with a matching ID
If johndoe is found, index.php will display a profile with the information for johndoe
If johndoe is not found, the visitor will see a 404 error, meaning that the user with that username does not exist
In order to find users, we'll first need to create a function that will take the username as a parameter and return a user object if it is a valid one.
Change the font size
Change margin width
Change background colour