Professional Documents
Culture Documents
PHPMaker Tutorial PDF
PHPMaker Tutorial PDF
Well be making a simple web application for a library. Members will be able to search the
library catalogue and list books by categories. Staffs will be able to add/edit/remove books as
well as register/deregister members.
You must create a database with your tables first. Open phpMyAdmin and write out your
MySQL statements. In our case we need to create two tables:
1
Every time youre working on PHPMaker, youll need to have XAMPP running.
Normally, the username should be root and the password field should be left empty. You can
always change that through phpMyAdmin for extra security. When you click on the Connect
button, you should see your two tables appear in the left panel.
2
User Login
Since, our app will require login, we need to set this up. Head over to the security tab.
Remember that members details will be stored in the users table. PHPMaker needs to know
that along with the names of columns for the username and password.
3
We are not done yet. We need to click on the Advanced button to set up additional user login
options.
4
The settings are self-explanatory. You might not check all of them, but user registration should
at least be enabled. Well come back to this later when well have to set permissions on who
can or cannot view/edit table and views.
5
Generating
Before generating the app, ensure that XAMPP is running. Set the application root folder to that
of XAMPP www folder. If you want PHPMaker to automatically open your browser after
generation, set the following option:
After generation, you will be presented with a login screen. You might not see the tables now
as you have not yet set permissions for user levels.
Right-click on the View option is the left panel, and select Create View from the context menu.
6
We need to write SQL statements for each view. Here the view will consist of all crime books.
Dont forget to give it a name. Repeat the same procedure of the other categories.
In the end, well obtain this:
7
PHPMaker lets you specify what kind of html tags each column of a table/view is generated
into. Since each book has a cover, we need to provide image upload/preview functionality.
Set an upload folder from the PHP tabbed menu:
Change the View tag to IMG and the Edit tag to file as follows:
What this does is display the cover when the table books is listed. Do the same for the views.
8
Arranging menu items
The Menu Editor from the tools menu lets you change the label for menu items, change it
appropriately.
Setting permissions
Obviously, a normal user should not be allowed to do edit/add operations on some tables. If
you remember, theres a user_level column in table users. By default,we made it zero.
PHPMaker has two built-in user levels (you can more): -1 and 0.
-1 is for administrator. 0 is the default. When a user registers, hes assigned 0 by default. Staff
will have their user level upgraded to -1 by the database administrator.
9
Generating a blank page
You can generate a blank page which you can fill with a welcome note for example. You can set it to be
the default page that will be opened when you open the app.
PHPMaker always generates a blank page named blankpage.php. Since youve entered the Start page
as being home.php, you must rename blankpage.php to home.php so PHPMaker can find and open it
the next time. If you make some changes to your project and generate again, your home.php will not be
overwritten. Look for it in the destination folder.
10