Booking & Scheduling
Appointment booking forms, availability calendars, and Stripe deposit flows — Claude deploys a complete PHP booking system in a single conversation. No SaaS booking plugin, no monthly per-booking fee.
Code Patterns
Booking & scheduling patterns
Three appointment system patterns — from a simple slot-based booking form to a full availability calendar with Stripe deposit payment. Pure PHP, MySQL, and vanilla JS — no Calendly, no BookingKit, no per-booking commission.
Pattern 1 — Appointment Booking Form
A simple, effective booking form with date and time slot selection, service type, and client details. PHP handler validates availability in real time, saves to MySQL, and sends dual confirmation emails — one to the client, one to the admin. No calendar UI required.
- HTML form: date picker (
<input type="date">), dynamically populated time slot<select>via JS fetch, service type dropdown, name/email/phone/notes fields - AJAX availability check: JS fetches
slots.php?date=YYYY-MM-DDon date change and rebuilds the slot dropdown — already-booked slots excluded book.php: server-side double-check of slot availability before insert (race condition safe)- MySQL
bookingstable:booking_ref,date,time_slot,service,name,email,phone,notes,status - Configurable slot duration (30 min, 60 min), day start/end time, and lunch break gap — all set in a PHP config array, no DB changes needed
- Dual SMTP emails: styled HTML confirmation to client (booking ref, date/time, service) and plain-text notification to admin
Build an appointment booking form for my site. Services offered: [Service A, Service B, Service C]. Available days: [Mon–Fri]. Slots: [9am–5pm], [60]-minute sessions with a [30]-minute lunch break from [1pm]. Store bookings in a MySQL bookings table. On date selection, fetch available slots via AJAX from slots.php. Validate availability server-side before insert. Send a confirmation email to the client and a notification to [admin@yourdomain.com] via SMTP. Generate a unique booking_ref per booking. CSS in theme.css, JS in main.js.
Pattern 2 — Visual Availability Calendar
A month-view calendar built in HTML, CSS, and vanilla JS that shows available days at a glance. Clicking a day reveals its available time slots. Fully configurable from a PHP array — block individual dates, set weekday patterns, add seasonal closures. No third-party calendar library.
- Month-view calendar: 7-column CSS Grid, prev/next month navigation with JS, today highlighted in brand colour
- Day states: available (default), fully booked (muted), unavailable/closed (strikethrough), today (highlighted)
- PHP
availability.phpserves a JSON array of blocked dates and remaining slots per date — fed from a config array + live bookings query - Click a day: JS fetches remaining slots, renders a slot picker below the calendar, submits to
book.php - Blocked date config: PHP array of ISO dates, day-of-week patterns (e.g. no Sundays), and date ranges (e.g. holiday closure)
prefers-reduced-motion: month transitions skip animation, slot picker appears instantly- Fully keyboard navigable: arrow keys move between days, Enter selects, Escape clears slot picker
Build a visual availability calendar for my booking page. Show a month-view calendar grid (CSS Grid, vanilla JS). Available days: [Mon–Sat]. Closed: [Sundays] and these specific dates: [YYYY-MM-DD, YYYY-MM-DD]. Clicking an available day fetches remaining [60]-minute slots from availability.php (JSON). Show the slot picker below the calendar. Submit booking to book.php which saves to a MySQL bookings table and sends confirmation via SMTP. Keyboard navigable. CSS in theme.css, JS in main.js.
Pattern 3 — Stripe Deposit Booking
Combines the appointment form with a Stripe Checkout deposit payment — the booking is only confirmed once the deposit clears. The Stripe webhook marks the booking as confirmed and triggers the confirmation email. Ideal for high-value appointments: consultations, shoots, events.
- Booking form saves details to MySQL with
status: pending_paymentand a uniquebooking_ref - On form submit, PHP creates a Stripe Checkout Session with the deposit amount and passes
booking_refasmetadata - Stripe redirects client to pay — success URL:
/booking-confirmed?ref={booking_ref} - Webhook handles
checkout.session.completed: readsbooking_reffrom metadata, updates MySQL status toconfirmed - SMTP confirmation email sent only after webhook confirms payment — not on form submit
- Uncompleted sessions: a PHP cron (or manual
admin/cleanup.php) releases slots withstatus: pending_paymentolder than 30 minutes - Configurable deposit amount: fixed value or percentage of service price
Build a deposit-gated appointment booking system. The booking form (name, email, service, date, time) saves to MySQL with status ‘pending_payment’. On submit, create a Stripe Checkout Session for a £[deposit_amount] deposit with booking_ref in metadata. On checkout.session.completed webhook, update status to ‘confirmed’ and send an SMTP confirmation email to the client. Add a cleanup endpoint to release slots with status ‘pending_payment’ older than 30 minutes. CSS in theme.css.
Every booking pattern includes
No per-booking commission
Calendly and Acuity charge monthly plus take a cut. Claude deploys your own booking engine — you own the code, the data, and every booking.
Configurable without code changes
Slot durations, available days, blocked dates, and service lists are set in PHP config arrays — update availability by editing one file, no DB migration required.
Double-booking prevention
Every booking write is validated server-side immediately before INSERT. Concurrent requests for the same slot result in only one successful booking — the other gets a polite error.
Fully iterable
Need a new service type, a different slot length, or a rescheduling flow? Describe the change to Claude and it updates your live booking system in the same session.
Pair bookings with
Complete your booking site with these building blocks.
Contact Forms
Pair a booking form with an enquiry form for clients who aren’t ready to commit to a slot yet.
View patterns →Auth & Members
Gate your booking system to logged-in members or subscribers with PHP session-based access control.
View patterns →Deploy your first booking system today
From £6.99/month — cancel anytime.