4. Directory & File Setup
Before we create a template, we need to set up some of the most common folders and file setup.
If you haven't done so already, go a head and create a new folder/directory just for this class. Call if anything you like, mine is "Create your own Facebook".
Inside this folder, you should have 5 folders, and 2 files.
Make the folders called "ajax", "images", "inc", "libs", "styles".
Most, if not all, of our Ajax files will go into "ajax".
All our images will go under "images".
Anything we need to php require or php include will go into the "inc" folder. "inc" = "includes".
Our libraries we will make will go under "libs". This is for our JavaScript/jQuery/PHP Libraries.
And "styles" is for all of our stylesheets (.css).
This is to keep everything organized.
Now lets make our first 2 files. The first one is our index.php file. Its the main page that shows up, and in our case, the Facebook login/signup page. If you don't already have an editor that can create a new PHP file for you, you might want to get one. For now, either open a new .php file, or open a new text file, copy this code and save it as "index.php".
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head><body>
</body>
</html>
If you're bent on sticking with the program you like, and it cannot create a new .php file with this code, please save this as master_php.php in your "Create your own Facebook" directory. Everytime you need to create a new .php, you'll have the code.
It should look like this so far:
Now create a new .css file and save it as "global.css" in the "styles" folder.
There's a chance we will add more folders later. We will definitely be adding subfolders later.
That's it for this class! Just a basic set up of folders and the first two files.