Before You Start
We are building a professional service business website. Adapt the content to whatever business or project you have in mind.
> I am building a new PHP website for a software development company called
"Ruban Softwares" based in Trichy, India.
Create the project folder structure:
/
├── index.php (homepage)
├── about.php
├── services.php
├── contact.php
├── blog/index.php
├── config/
│ ├── db.php (PDO database connection)
│ └── site.php (site name, contact info, constants)
├── includes/
│ ├── header.php (HTML head + navigation)
│ └── footer.php (footer + scripts)
└── assets/
├── css/style.css
└── js/main.js
Create a CLAUDE.md with the project description and stack:
PHP 8.2, MySQL 8, Bootstrap 5.3, no frameworks.
Create all the empty files with appropriate placeholder content.
Phase 1: Foundation
> Create config/site.php with these constants:
SITE_NAME = 'Ruban Softwares'
SITE_TAGLINE = 'Delivering Digital Excellence'
SITE_EMAIL = 'info@rubansoftwares.com'
SITE_PHONE = '+91 98765 43210'
SITE_ADDRESS = 'Trichy, Tamil Nadu, India'
BASE_URL = 'http://localhost/rubansoftwares/'
And config/db.php with a PDO connection using:
host=localhost, db=rubansoftwares, charset=utf8mb4
Credentials read from environment variables DB_USER and DB_PASS.
> Create includes/header.php with:
- Full HTML5 document head (charset UTF-8, viewport meta, Bootstrap 5.3 CDN)
- Bootstrap navbar with:
- Logo (SITE_NAME constant) on the left
- Nav links: Home, About, Services, Blog, Contact
- Active class on current page (use $_SERVER['PHP_SELF'])
- Hamburger menu that works on mobile
- The file starts with require_once('../config/site.php')
- Include an $page_title variable in the title tag
> Create includes/footer.php with:
- 3-column Bootstrap footer:
Column 1: Company name, tagline, social media icons (Facebook, LinkedIn, Twitter)
Column 2: Quick Links (same as navbar)
Column 3: Contact info (phone, email, address from constants)
- Copyright: "© 2025 Ruban Softwares. All Rights Reserved."
- Bootstrap JS CDN
- Custom JS file link: assets/js/main.js
> Create assets/css/style.css with:
- CSS variables: --primary: #1a56db, --secondary: #6c757d, --dark: #0f172a
- Override Bootstrap's primary color to use --primary
- Hero section: full-width gradient background, centered text, padding 100px
- Card hover effect: slight lift with shadow
- Smooth scroll behavior
- Footer: dark background (#0f172a), white text
- Section padding: 80px top/bottom consistently
Phase 2: Pages
> Build index.php (homepage) with:
- Hero section: headline "Delivering Digital Excellence", subheadline,
two buttons: "View Services" and "Contact Us"
- Services preview: 4 cards (Web Development, Mobile Apps, Cloud Solutions, AI Integration)
each with icon (Bootstrap Icons), title, 2-line description
- Why Choose Us: 3 columns with icon + heading + text
(10+ Years Experience, 200+ Projects, 24/7 Support)
- Recent Blog Posts: placeholder for 3 cards (we will fill from DB later)
- CTA Section: full-width colored bar, "Ready to start?" headline, "Get a Quote" button
Include header.php and footer.php. Use $page_title = 'Home - SITE_NAME'
> Build about.php with:
- Page hero: "About Us" heading with breadcrumb
- Company story section: 2 columns (text left, placeholder image right)
Text: founding year 2015, mission statement, vision
- Team section: 4 team member cards with photo placeholder,
name, role, LinkedIn icon link
- Stats bar: 4 counters (200+ Projects, 50+ Clients, 10+ Years, 15+ Team Members)
with animated count-up effect using JavaScript
- Values section: 6 values with icons (Integrity, Innovation, Quality, etc.)
> Build services.php with:
- Page hero with breadcrumb
- Services grid: 6 service cards in a 3-column grid, each with:
icon, title, 3-line description, "Learn More" button
Services: Web Development, Mobile Apps, E-commerce, Cloud Solutions,
AI/ML Integration, Digital Marketing
- Process section: 4 numbered steps (Discovery, Design, Development, Deployment)
each with icon and 2-line description
- Pricing teaser: 3 plan cards (Basic, Professional, Enterprise)
with price placeholder and "Contact for Quote" button
> Build contact.php with:
- Page hero with breadcrumb
- 2-column layout:
Left: contact form (Name, Email, Phone, Service dropdown, Message textarea, Submit)
Right: contact info card (address, phone, email, business hours, Google Maps embed placeholder)
- Form processing PHP at top:
- Validate all fields
- Save to contacts table: id, name, email, phone, service, message, created_at, ip_address
- Show success/error message
- Use POST/Redirect/GET pattern to prevent resubmission
- Create the SQL: CREATE TABLE contacts ...
Database connection from config/db.php
Phase 3: Features
> Build a simple blog system:
CREATE TABLE posts (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
slug VARCHAR(255) UNIQUE NOT NULL,
excerpt TEXT,
content LONGTEXT,
featured_image VARCHAR(255),
category VARCHAR(100),
author VARCHAR(100) DEFAULT 'Admin',
status ENUM('draft','published') DEFAULT 'draft',
published_at DATETIME,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
blog/index.php: Blog listing page
- Show published posts, 6 per page
- Category filter buttons at top
- Each post card: image, category badge, title, excerpt, date, "Read More"
- Pagination
blog/post.php?slug=:
- Single post page
- Previous/Next post navigation
- Related posts (same category, max 3)
> Create a simple password-protected admin panel at admin/:
- admin/login.php: username/password form
Credentials hardcoded in config/site.php (ADMIN_USER, ADMIN_PASS as hash)
Creates session on success, redirects to admin/index.php
- admin/index.php: list all blog posts (title, status, date, Edit/Delete buttons)
- admin/post-form.php: create/edit post form
(title, slug auto-generated from title via JS, excerpt, content textarea,
category, status, published_at, file upload for featured image)
- admin/delete.php: delete post (POST only, with confirmation)
All admin pages check session, redirect to login if not authenticated.
Phase 4: Polish
> Update includes/header.php to support SEO variables.
Each page sets these before requiring header.php:
$page_title, $meta_desc, $meta_keywords, $og_image, $canonical_url
Add to the HTML head:
- using $meta_desc
- using $meta_keywords
- Open Graph tags: og:title, og:description, og:image, og:type, og:url
- Twitter card tags
- using $canonical_url
Set sensible defaults if variables are not set.
> Add security and performance improvements:
1. Create .htaccess with:
- Redirect HTTP to HTTPS
- Clean URLs (remove .php extension)
- Deny access to /config/, /includes/, .env files
- Enable gzip compression
- Set cache headers for assets (1 year for CSS/JS/images)
2. Add CSRF protection to the contact form:
- Generate token in session
- Verify on form submission
3. Add rate limiting to contact form:
- Max 3 submissions per IP per hour
- Track in a rate_limits table
Full Prompt Reference
Quick reference of all 13 prompts in order:
| # | Prompt | Output |
|---|---|---|
| 1 | Project structure + CLAUDE.md | All empty files created |
| 2 | Config files | config/site.php + config/db.php |
| 3 | Header | includes/header.php |
| 4 | Footer | includes/footer.php |
| 5 | CSS foundation | assets/css/style.css |
| 6 | Homepage | index.php |
| 7 | About page | about.php |
| 8 | Services page | services.php |
| 9 | Contact form + DB | contact.php + SQL |
| 10 | Blog system | blog/index.php + post.php + SQL |
| 11 | Blog admin panel | admin/ (login, list, form, delete) |
| 12 | SEO meta tags | Updated header.php |
| 13 | Security + performance | .htaccess + CSRF + rate limit |
Replace "Ruban Softwares" with your project name, replace the service categories with your actual services, and replace all placeholder content with real content as you go. The prompts work for any service business, portfolio, or informational website.