Skip to content

PabloGarayOk/Formulario-de-contacto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Website Contact Form (Fixed Recipient)

This project is a production-ready contact form developed in PHP, designed to be integrated into a client website.

Unlike a generic contact form where the message is sent to an arbitrary recipient, this implementation sends all messages to a fixed email address configured in the backend, which is the standard behavior for website contact forms.

The sender’s email is collected to allow replies, not to define the destination.

Key Concept

  • Recipient email is configured in PHP
  • Sender email is provided by the user
  • Designed for real-world website usage

Features

  • Multi-layer validation:
    • HTML5 required fields
    • JavaScript client-side validation
    • PHP server-side validation
  • Fixed recipient email configuration
  • Clean and readable PHP code
  • Centralized message handling
  • Easy to integrate and customize
  • Email sending via PHP mail()

Configuration

To set the recipient email address, edit the following file: php/enviar-mail

Update the $to variable:

$to = 'your-email@example.com'; // Replace with the desired recipient

Technologies & Concepts

  • PHP
  • JavaScript
  • HTML5
  • CSS
  • Form handling
  • Server-side validation
  • Reusable and maintainable structure

Project structure

  • index.php — Contact form UI
  • js/form_mail.js — Client-side validation
  • php/enviar-mail.php — Server-side validation and email sending
  • php/mensajes.php — Centralized response messages
  • css/estilos.css — Styling

Notes

  • Intended for use in real websites
  • Easily adaptable to different designs
  • Focused on clarity and maintainability

Author

Pablo Garay
Personal website

About

This project is a production-ready contact form developed in PHP

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors