Siteβ―Builder
Editing:
advertise.txt
writable 0666
<?php // Basic prettify for geo string function pretty_geo($geo) { // e.g. seminole-fl-advertising β Seminole, FL Advertising $geo = preg_replace('/-([a-z]{2})-advertising$/i', ', $1 Advertising', $geo); $geo = str_replace('-', ' ', $geo); $geo = ucwords($geo); return $geo; } $geo = isset($_GET['geo']) ? $_GET['geo'] : ''; $page_headline = $geo ? 'Advertise in ' . pretty_geo($geo) : 'Advertise With Us'; // Handle POST submission $sent = false; $err = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Honeypot if (!empty($_POST['website2'])) { $err = "Form failed spam test."; } else { $fields = [ 'Business Name' => $_POST['business_name'] ?? '', 'Phone' => $_POST['phone'] ?? '', 'Email' => $_POST['email'] ?? '', 'Website' => $_POST['website'] ?? '', 'Website Details' => $_POST['website_details'] ?? '', 'Hours' => $_POST['hours'] ?? '', 'Category' => $_POST['category'] ?? '', 'Referral Code' => $_POST['referral'] ?? '', 'Geo Target' => $_POST['geo'] ?? '', 'IP Address' => $_SERVER['REMOTE_ADDR'] ?? '', 'User Agent' => $_SERVER['HTTP_USER_AGENT'] ?? '' ]; $message = ''; foreach ($fields as $k => $v) { $message .= "$k: $v\n"; } $to = "support@quantaxtechnology.com"; $subject = "New Advertising Lead - " . ($fields['Geo Target'] ? $fields['Geo Target'] : 'Unknown Location'); $headers = "From: BestDealOn <no-reply@bestdealon.com>\r\n"; if (mail($to, $subject, $message, $headers)) { $sent = true; } else { $err = "Sorry, there was a problem sending your request. Please try again later."; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title><?= htmlspecialchars($page_headline) ?> | BestDealOn</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="robots" content="noindex,follow"> <style> body { background:#f5f8fb; font-family:system-ui,Arial,sans-serif; margin:0; color:#273549;} .form-card { background:#fff; max-width:460px; margin:2.5rem auto 2rem; border-radius:18px; box-shadow:0 2px 12px 0 rgba(48,65,105,.10); padding:2.2rem 1.6rem 1.5rem;} .form-card h2 { font-size:1.27rem; font-weight:800; color:#3548a3; margin-bottom:.4em; } .form-card p { font-size:1.08em; margin:.4em 0 1em 0;} form label { display:block; margin-top:1.07em; margin-bottom:.28em; font-weight:500;} input, textarea, select { width:100%; border-radius:8px; border:1px solid #d7e0f0; font-size:1.07em; padding:.68em .7em; margin-bottom:.1em; background:#f8fafc;} input[type="submit"] { margin-top:.85em; font-weight:700; background:#5b36ff; color:#fff; border:none; transition:background .17s;} input[type="submit"]:hover { background:#2d21b6;} input[type="text"],input[type="email"],textarea,select { transition: border .14s;} input:focus, textarea:focus, select:focus { border:1.5px solid #6ab1ff; outline:none;} input[type="hidden"] { display:none;} .form-row { display:flex; gap:1em; } .form-row > div { flex:1;} @media (max-width: 520px) { .form-card { max-width:99vw; padding:1em; } } .success-box { background:#e0fbe0; border:1.5px solid #87d18b; color:#29782b; font-weight:600; margin-bottom:1em; padding:1em 1.2em; border-radius:10px; } .error-box { background:#fde6e4; border:1.5px solid #fa9797; color:#c52b22; font-weight:600; margin-bottom:1em; padding:1em 1.2em; border-radius:10px; } </style> </head> <body> <div class="form-card"> <h2><?= htmlspecialchars($page_headline) ?></h2> <p> <?php if($geo): ?> Boost your visibility in <b><?= htmlspecialchars(pretty_geo($geo)) ?></b> and connect with customers who are searching for your services right now. <span style="color:#294; font-weight:500;">Claim your spot before your competitors do!</span> <?php else: ?> Reach more local customers and get your business seen on BestDealOn! <?php endif; ?> </p> <?php if($sent): ?> <div class="success-box">Thank you! Your request has been received. We will contact you soon.</div> <?php elseif($err): ?> <div class="error-box"><?= htmlspecialchars($err) ?></div> <?php endif; ?> <?php if(!$sent): ?> <form method="post" autocomplete="on"> <label for="business_name">Business Name</label> <input type="text" name="business_name" id="business_name" maxlength="60" required> <div class="form-row"> <div> <label for="phone">Phone Number</label> <input type="text" name="phone" id="phone" maxlength="20" placeholder="(xxx) xxx-xxxx" required> </div> <div> <label for="email">Email Address</label> <input type="email" name="email" id="email" maxlength="70" required> </div> </div> <label for="website">Website</label> <input type="text" name="website" id="website" maxlength="100" placeholder="https://"> <label for="website_details">Website Details or Offer</label> <textarea name="website_details" id="website_details" rows="2" maxlength="400" placeholder="Describe your site, special, or promotion"></textarea> <label for="hours">Hours of Operation</label> <input type="text" name="hours" id="hours" maxlength="60" placeholder="Mon-Fri 9am-6pm, Sat 10-2"> <label for="category">Category</label> <select name="category" id="category" required> <option value="">β Select Category β</option> <option>Restaurants</option> <option>Home Services</option> <option>Real Estate</option> <option>Automotive</option> <option>Lawyers</option> <option>Dentists</option> <option>Plumbers</option> <option>HVAC</option> <option>Roofing</option> <option>Landscaping</option> <option>Electricians</option> <option>Insurance</option> <option>Medical</option> <option>Gyms</option> <option>Contractors</option> <option>Other</option> </select> <label for="referral">Referral Code (if any)</label> <input type="text" name="referral" id="referral" maxlength="30"> <!-- Hidden geo, and honeypot anti-spam --> <input type="hidden" name="geo" value="<?= htmlspecialchars($geo) ?>"> <input type="text" name="website2" style="display:none;" autocomplete="off"> <input type="submit" value="Submit Advertising Request"> </form> <?php endif; ?> <p style="margin-top:1.7em;font-size:1.01em;color:#7883a6;"> BestDealOn helps local businesses in <?= htmlspecialchars($geo ? pretty_geo($geo) : "your area") ?> get seen for searches like advertising, marketing, and local business listings. </p> </div> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel