What are some best practices for beginners in PHP who want to create a website for a non-profit organization?

Best practices for beginners in PHP creating a website for a non-profit organization include using a secure and reliable web hosting service, organizing code into separate files for better maintainability, utilizing frameworks like Laravel or CodeIgniter for efficiency, implementing responsive design for mobile compatibility, and regularly updating and backing up the website.

<?php

// Example code snippet for creating a simple contact form in PHP

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = $_POST['message'];

    // Code to process and store the form data goes here

    // Redirect to a thank you page after form submission
    header("Location: thank-you.php");
    exit;
}

?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text" name="name" placeholder="Your Name" required><br>
    <input type="email" name="email" placeholder="Your Email" required><br>
    <textarea name="message" placeholder="Your Message" required></textarea><br>
    <input type="submit" value="Submit">
</form>