
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.
Table of Contents
- π‘ The Client's Need: Simplicity, Speed, and Control
- π οΈ Why Hostinger?
- π Folder Structure
- π Step 1: Creating the HTML Website (index.html)
- π© Step 2: Handling the Form Submission (contact.php)
- How to create or upload a custom website to Hostinger?
- π Step 3: Securing the Leads File with .htaccess
- π Create a .htaccess File
- β Steps in Hostinger File Manager:
- π Why This Approach Works for Local Businesses
- π Want to Try It Yourself?
- π Final Thoughts
π‘ 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:
- Stores the message in a
.txt
file - 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:
- Go to hPanel > File Manager
- Open the
/public_html/
folder - Click βNew Fileβ and name it
.htaccess
- 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!

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.