Archive for the ‘NetBeans’ Category
STEP 1: Install XAMMP including PHP and MySQL Database.
- Install XAMMP following from link: http://www.apachefriends.org/en/xampp-windows.html
- Run the xammp setup .exe file.
- On Microsoft Vista, the User Access Control feature blocks the PHP installer from updating the Apache httpd configuration. Disable UAC while you are installing XAMPP.
- You are given the option to install the Apache server and the MySQL database server as services. If you install the Apache Server and MySQL as services, you will not have to start them manually through the XAMP Control Panel.
- If you are using the self-extracting archive, after the archive is extracted, run the file setup-xampp.bat to configure the components of the package. (The XAMPP installer runs this file automatically.)
- After configuration, open the XAMP Control Panel. (You can open it manually by running the file XAMPP_HOME/xampp-control.exe or from the Xampp Control Panel icon that is automatically placed on your desktop.) When you open the XAMPP Control Panel, note that the modules that are installed as services are already running.
Warning: On Windows Vista sometimes xampp-control.exe will not run. You can run xampp-start.exe instead.
- The Svc checkboxes indicate that a module is installed as a Windows service and will start automatically on system startup. You can install or uninstall Windows services by selecting or unselecting the Svc checkbox. Uninstalling a Windows service does not uninstall the module, but it does require you to start the module manually. The XAMPP control panel includes buttons for stopping and starting modules and opening their administration consoles
STEP 2: Install NetBeans 6.9.1 IDE for PHP
Download and Install NetBeans IDE for PHP from following link: http://netbeans.org/downloads/index.html
STEP 3: Setting up Your first PHP Project in the NetBeans IDE for PHP
- Start the IDE, switch to the Projects window, and choose File > New Project. The Choose Project panel opens.
- In the Categories list, choose PHP.
- In the Projects area, choose PHP Application and click Next. The New PHP Project > Name and Location panel opens..
- In the Project Name text field, enter hello-world.
- In the Sources Folder field, browse for your PHP document root and create a subfolder there called hello-world. The document root is the folder where the web server looks for files to open in the browser. The document root is xampp/htdocs.
- Leave all other fields with their default values. Click Next.
- In the Run As drop-down list, select Local Web Site. The project will run on your local Apache server.
- Click Finish.
Practical: Creating a CRUD Application with NetBeans IDE PHP Editor
Aim: To create and run a simple web application called wish list.
Designing the Structure of the Sample Database
To arrange and store all the necessary data you need two tables:
- A wishers table for storing names and passwords of registered users
- A wishes table for storing descriptions of wishes
- id – the unique ID of a wisher. This field is used as the Primary Key
The wishes table contains four fields:
- id – the unique ID of a wish. The field is used as the Primary Key
- wisher_id – the ID of the wisher to whom the wish belongs. The field is used as the Foreign Key.
- due_date – the date by when the wish is requested
The tables are related through the wisher’s ID. All the fields are mandatory except due_date in wishes.
The scope of your application covers the following use cases:
- The user views the wish list of a person.
- The user registers as a new wisher.
- The user logs in and creates her/his wish list.
- The user logs in and edits his/her wish list.
To cover this basic functionality, you will need to implement the following pages:
- The “front” page index.php for logging in, registering, and switching to wish lists of other users.
- The wishlist.php page for viewing the wish list of a particular wisher.
- The createNewWisher.php for registering as a wisher.
- The editWishList.php page for editing a wish list by its owner.
- The editWish.php page for creating and editing wishes.
Initially I thought of making video tutorial for this scenario, but the resource website from which this tutorial has been studied is awsome with respect to explanation and step by step approach. Hence, instead of developing a clone tutorial, i request you to go to following link.
Note: Before using tutorial just go through my video for creating and managing users of MySQL database including root user, which is you should check out to save time in understanding settings and previleges for MySQL database users.