Skip to content
Home Β» Blog Β» Digital Marketing Β» AI Β» How I Built a Custom Website with Contact Form for a Flower Business Using Hostinger (No WordPress Needed)

How I Built a Custom Website with Contact Form for a Flower Business Using Hostinger (No WordPress Needed)

I just imagined building a custom website with the help of Hostinger and ChatGPT. If a client wants something truly lightweight, fast, and custom-built. Let me share how I created an imagined project for a local flower business, and how I did it entirely using ChatGPT custom code and hosted on Hostinger.

🏑 The Client’s Need: Simplicity, Speed, and Control

I imagined it as a digital marketing intern, where a local flower shop owner approached me. She wanted to build a customized website for his flower business.

His requirements were clear:

  • A clean, simple website
  • A contact form where customers could send messages
  • No WordPress, no builders, no fluff

This was the perfect opportunity to create a custom-coded website with a contact form that stores data and sends a welcome email.

πŸ› οΈ Why Hostinger?

I chose Hostinger for this project because:

  • It offers reliable PHP and file manager support
  • I could easily upload custom HTML and PHP files
  • It’s beginner-friendly but powerful

With just a few files, I could build a fully functioning custom website.

πŸ“ Folder Structure

Here’s how I structured the project inside the /public_html/ directory:

/public_html/
β”œβ”€β”€ index.html
β”œβ”€β”€ contact.php
└── leads.txt   (auto-created)

πŸ“„ Step 1: Creating the HTML Website (index.html)

This is the main page customers see:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BloomLocal Flowers</title>
</head>
<body>
    <h1>Welcome to BloomLocal Flowers 🌸</h1>
    <p>Fresh flowers for every occasion. Contact us below!</p>

    <h2>Send Us a Message</h2>
    <form action="contact.php" method="POST">
        <input type="text" name="name" placeholder="Your Name" required><br><br>
        <input type="email" name="email" placeholder="Your Email" required><br><br>
        <textarea name="message" placeholder="Your Message" required></textarea><br><br>
        <button type="submit">Send</button>
    </form>
</body>
</html>

πŸ“© Step 2: Handling the Form Submission (contact.php)

This PHP script does two things:

  1. Stores the message in a .txt file
  2. Sends an automatic welcome email
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
    $name = htmlspecialchars($_POST["name"]);
    $email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL);
    $message = htmlspecialchars($_POST["message"]);

    // Save to file
    $entry = "Name: $name | Email: $email | Message: $message" . PHP_EOL;
    file_put_contents("leads.txt", $entry, FILE_APPEND | LOCK_EX);

    // Send auto-reply
    $subject = "Thanks for contacting BloomLocal Flowers 🌸";
    $body = "Hi $name,\n\nThanks for reaching out to BloomLocal Flowers. We’ll get back to you shortly!\n\nWith love,\nTeam BloomLocal";
    $headers = "From: contact@yourdomain.com";

    mail($email, $subject, $body, $headers);

    echo "Thanks! Your message has been sent.";
} else {
    echo "Invalid request.";
}
?>

How to create or upload a custom website to Hostinger?

πŸ” Step 3: Securing the Leads File with .htaccess

We don’t want visitors to access leads.txt directly. Here’s how to protect it:

πŸ“„ Create a .htaccess File

In the same folder (/public_html/), create a file named .htaccess and add this code:

<Files "leads.txt">
    Order allow,deny
    Deny from all
</Files>

βœ… Steps in Hostinger File Manager:

  1. Go to hPanel > File Manager
  2. Open the /public_html/ folder
  3. Click β€œNew File” and name it .htaccess
  4. Paste the code above and save

This makes sure no one can open https://yourdomain.com/leads.txt in their browser.

πŸ“Š Why This Approach Works for Local Businesses

  • βœ… Fast: No bloated themes or plugins
  • βœ… Cheap: No need to pay for premium builders
  • βœ… Custom: Every element is 100% yours
  • βœ… Practical: Data stored and email sent automatically

For small local businesses like BloomLocal Flowers, this is an ideal solution.

πŸš€ Want to Try It Yourself?

I imagined this project, and I tried it with the help of ChatGPT and Hostinger. You can also try.

(Note: Update contact@yourdomain.com to your own domain email for emails to work reliably.)

πŸ’‘ Want to give it a stunning look? Add a style.css file and link it in your HTML to beautifully style the form, layout, and overall site. It’s a simple next step to level up your project!

🌟 Final Thoughts

This project taught me how much you can accomplish with just a few lines of clean code and a reliable host like Hostinger. If you’re a digital marketer or freelancer, learning how to build and host custom websites like this can seriously level up your value to local businesses.

Want to learn how to build advanced features like CRM integration or Google Sheets sync? Let me know in the comments or reach outβ€”I’m here to help!

Boost your online presence

Author Profile

Anup Ain

Hey, my name is Anup Ain. I am a blogger and a digital marketing intern. I enjoy sharing my knowledge and experiences with others.