Coder Social home page Coder Social logo

test's Introduction

Task. Create a contact us page

Using PHP, HMTL and JavaScript write a “contact us” page

Requirements:

  1. On the page a form with the following fields must be created: Name* - string, 3-50 chars Email* - string, valid email Subject* - string, 3-50 chars. Message

The fields marked with * are mandatory. Add a submit button.

  1. When the submit button is clicked, the following should happen: a. An email with all above defined fields should be sent to a predefined email address. In case you don’t have access to an SMTP server, mock it. b. all relevant information is logged to a database c. the user will be informed about the success/error of the action

  2. Feel free to create and use your own stylesheet and layout

  3. Demonstrate MVC, OOP, Security Concepts as needed. The time effort of this assignment should not be more than 4 hours. The main purpose of the assignment is to create a basis for discussion of high-level concepts.

Installation

  1. Clone repo

     git clone https://github.com/tateana/test.git --recursive
    
  2. Apache Setup

     <VirtualHost *:80>
         ServerName test
         DocumentRoot /path/to/test/public
         <Directory /path/to/test/public>
             DirectoryIndex index.php
             AllowOverride All
             Order allow,deny
             Allow from all
         </Directory>
     </VirtualHost>
    
  3. DB Schema

     CREATE TABLE IF NOT EXISTS `messages` (
       `id` int(11) NOT NULL AUTO_INCREMENT,
       `name` varchar(50) NOT NULL,
       `email` varchar(50) NOT NULL,
       `subject` varchar(100) NOT NULL,
       `message` text NOT NULL,
       PRIMARY KEY (`id`)
     ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
    
  4. Configs in config/autoload.

    4.1 Rename files db.local.php.dist.php to db.local.php and mail.local.dist.php to mail.local.php

    4.2. Configure the files above

  5. If you use file mail transport, give permissions to write to the "data" folder.

  6. Install the intl extension. http://php.net/manual/ru/intl.setup.php

test's People

Contributors

tateana avatar

Watchers

James Cloos avatar  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.