📁 File Manager
Editing:
/home/wvl7mof7402e/www/domain/emails/add.php
<?php include '../db.php'; ?> <?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { $stmt = $conn->prepare("INSERT INTO emails (client_id, email_address, provider, renewal_date, status) VALUES (?, ?, ?, ?, 'active')"); $stmt->execute([ $_POST['client_id'], $_POST['email_address'], $_POST['provider'], $_POST['renewal_date'] ]); header("Location: index.php"); } ?> <h2>Add Email Record</h2> <form method="post"> <label>Client:</label> <select name="client_id" required> <?php $clients = $conn->query("SELECT id, name FROM clients")->fetchAll(); foreach ($clients as $c) { echo "<option value='{$c['id']}'>{$c['name']}</option>"; } ?> </select><br> <input type="email" name="email_address" placeholder="Email (e.g., info@domain.com)" required><br> <input name="provider" placeholder="Email Provider (e.g., Gmail, Zoho)" required><br> <input type="date" name="renewal_date" required><br> <button type="submit">Save</button> </form>
Save
Cancel