Code Monkey home page Code Monkey logo

test's Introduction

MVC

An extremely simple and easy to understand MVC skeleton application, reduced to the max.

Goals of this project:

  • Anonymous user is allowed to enter data using the form field
  • User data is shown in preview page before inserting into database
  • Upon confirmation from preview page data is inserted into database
  • unique token is generated for every form submit to prevent CSRF attack
  • PDO is used to prevent sql injection

error logs

  • application or database errors are captured into public/logs/logs.txt file

Installation

  1. Run the SQL statements in the application/_install folder.

  2. Change the .htaccess file from

RewriteBase /mvc/

to where you put this project, relative to the web root folder (usually /var/www). So when you put this project into the web root, like directly in /var/www, then the line should look like or can be commented out:

RewriteBase /

If you have put the project into a sub-folder, then put the name of the sub-folder here:

RewriteBase /sub-folder/
  1. Edit the application/config/config.php, change this line
define('URL', 'http://localhost/mvc/');

to where your project is. Real domain, IP or 127.0.0.1 when developing locally. Make sure you put the sub-folder in here (when installing in a sub-folder) too, also don't forget the trailing slash !

  1. Edit the application/config/config.php, change these lines
define('DB_TYPE', 'mysql');
define('DB_HOST', 'localhost');
define('DB_NAME', 'php-assignment');
define('DB_USER', 'root');
define('DB_PASS', '');

to your database credentials. If you don't have an empty database, create one. Only change the type mysql if you know what you are doing.

test's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.