Sourcecode : here

As my 5th semester COP (Computer Oriented Project) I took some of the PHP development(with MySQL database) oriented project which is based on CMS . This is one of the first developments by me. I am not saying that this will help someone learning PHP . But a beginner (or who knows nothing about PHP) can understand the code and the total working process if he takes a close look at it. It is just a code which authenticates a user and allows him to give feedback on different subjects that he wants to .So this application is as simple as just getting the input from a end user and inserting the record to a database in the server . In this i used $_SESSION variables to store the session data of the user to use it in different pages . Also i have taken care so that the user can not submit the same feedback (intentionally or by mistake by pressing the submit button twice). This can be seen in submit.php file. This i am achieving by setting the $alreay_once flag to 1 if the same post has been submitted.

For trying this what you do is install LAMP-Server (in Linux platforms) or install any servers wamp,xampp(in Windows platforms) . It can be done by sudo apt-get install lamp-server^ in Linux platform or do a sudo tasksel in your terminal and installing from there. For windows users you can find the binary for installation of wamp server here.

Then you need to create the tables for the storage of the data in the MySQL database.So just login to your mysql console with proper privilege.Then create a database named 'feedback' using CREATE DATABASE feedback; in the database. Then type the following blocks one-by-one or just save it in a text file and import it in phpmyadmin.

  SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

  --
  -- Database: `feedback`
  --

  -- --------------------------------------------------------

  --
  -- Table structure for table `accounts`
  --

  CREATE TABLE IF NOT EXISTS `accounts` (
  `username` varchar(64) NOT NULL,
  `password` varchar(64) NOT NULL,
  `attrib` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  -- --------------------------------------------------------

  --
  -- Table structure for table `main`
  --

  CREATE TABLE IF NOT EXISTS `main` (
  `username` varchar(64) NOT NULL,
  `subject` varchar(600) NOT NULL,
  `comment` text NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Now the sql part is done.Then you copy the feedback folder (the sourcecode in the begining) to your /var/www/ directory ( In Linux platforms ) or your document root directory (in Windows ) . Then you need to go to the feedback/config folder. And need to change the variables $db_user and $db_password to your actual mysql root user username and password.Now you are done with your settings. Now you need to test if it is working or not. So just open up your browser and go to the address http://localhost/feedback or http://127.0.0.1/feedback to check the site. Enjoy manipulating and testing or using it for your needs . Thank you . Please pass comments

:)

N.B :In the MySQL database the attrib column is used to differentiate between the administrator and normal users . its value=2 means its admin and 1 means its normal user.

This may not be efficient because it is my very first PHP development and i have not looked into it after finishing it. So please feel free to modify it and use it as per your needs.

And please suggest me a proper site for file uploading .