Php contact form
This project uses PHP 8
This is an extension to my datacode interview questions. This is a fully working response form with email functionality as well as database manipulation.The form can be translated from french, english and pirate based on the browser language.
In order to use this in your environment you will require:
Postfix, Phpmailer, Mariadb
SQL for setting up the tables that are used in this application
create table frmResponses
(
ResponseID int auto_increment,
Response varchar(255) default '' null,
First_Name varchar(255) default '' null,
Last_Name varchar(255) default '' null,
Email_Address varchar(255) default '' null,
constraint frmResponses_pk
primary key (ResponseID)
);
For setting the DB connection I have provided a json file within settings/db.json
{
"HOST": "",
"USERNAME": "",
"PASSWORD" : "",
"DATABASE" : ""
}
For setting the Email Settings I have provided a json file within settings/mailersettings.json
{
"PORT": 587,
"HOST": "smtp.example.com",
"USERNAME": "[email protected]",
"PASSWORD" : "example",
"SMTP_AUTH": true,
"MAILER": "smpt",
"SMTP_SECURE": "tls",
"IS_HTML": true
}
I used php -S 0.0.0.0:8000 -t path-to-dir