Before developing a PHP page, we have to install full package of testing server of PHP (Apache) and database platform (MySQL) called Apache.
Steps to install XAMPP.
- Download XAMPP from any web such as http://www.apachefriends.org/index.html (XAMPP provide Apache + MySQL + Perl and so on).
- Make sure to stop IIS server so Apache will be running smoothly.
- Follow the instruction to install.
- Folder "C:\:xampp" will be created automatically.
- Click start if the Apache and MySQL are still not starting
- Open any Web Browser and type http://localhost (your Apache will be appeared)
- Choose english language (according to your priority)
- Setup the security of Apache. Click "Security > http://localhost/security/xamppsecurity.php "
- Create your own password with MySQL SuperUser : root (eg. MySQL username : root, password : 1234)
- You are ready to use MySQL
Steps to develop a PHP page (similar to develop an ASP page):
- Create a database first - MySQL
- Create a site before develop a webpage in Dreamweaver
- Create a connection to the database in Dreamweaver
- Create a PHP file - consists of form and textfield
- Use Insert Record to save the data into the database
- Create a PHP file to view back data from the database
- Use RecordSet to view the data from the database
- Use Repeat Region to view all data.
- Create a PHP file to make a user authentication
- Use User Authentication > Restricted Page ()
- Use User Authentication > Login User
Create a database first using MySQL
- Create database and table : eg. dataphp
- Folder dataphp will be added to C:/xampp/mysql/data/dataphp automatically
Create a site before develop a webpage in Dreamweaver
- Choose Site>New Site
- Create a folder (eg. projek) - the folder must be in C:/xampp/htdocs/projek
- Add server with web URL = http://localhost/projek/
- Make sure to choose Testing Server > PHP MySQL
Create a connection to the database in Dreamweaver
- Open Adobe Dreamweaver CS6
- Choose a PHP blank page
- Choose Database > + > MySQL Connection
- Fill the blank like shown
Create a PHP file - consists of form and textfield
- Use Insert Record to save the data into the database
- Open a new blank PHP file
- Save as contact.php
- Insert form, textfield with 5 elements (firstname, username, email, website and message) and a submit button.
- Choose Server Behaviour > Insert Record and fill in the blank
- Use User Authentication > Restrict Access to Page (will be explained in creating login page part)
Create a PHP file to view back data from the database
- Use RecordSet to view the data from the database
- Use Repeat Region to view all data.
- Open a new blank PHP file
- Save as view.php
- Create a table fill with firstname, username, email, website and message and create a line (to separate the informations viewed from different users)
- Choose Bindings > Recordset (Query)
- Select the table and the line made.
- Choose Server Behaviour > Repeat Region
Create a PHP file to make a registration page
- Create a new table in folder C:/xampp/mysql/data/dataphp using MySQL
- Use Insert Record to save the data into the database
- Create a new table with MySQL
- Open a new blank PHP file
- Save as registration.php
- Insert form, textfield with 4 elements (name, username, password, email) and a submit button.
Create a PHP file to make a login page
- Use User Authentication > Login Page
- Open a new blank PHP file
- Save as login.php
- Insert form, textfield with 2 elements (username and password) and a submit button.
- If the user inserts wrong username and password - the page will be back to the registration page.
I hope you can develop a dynamic page as well using PHP!!
No comments:
Post a Comment