HostPioneers - AI Agent Hiring Platform
Features: - AI Agent Hiring API (/api/hire) - Agent Discovery (/api/agents.json) - Stripe Checkout Integration - Webhooks for payment notifications - Telegram + Email alerts - Mobile responsive design - SEO optimized - AI-to-AI commerce ready Built: March 2026
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$name = trim($_POST['name'] ?? '');
|
||||
$email = trim($_POST['email'] ?? '');
|
||||
$phone = trim($_POST['phone'] ?? '');
|
||||
$message = trim($_POST['message'] ?? '');
|
||||
|
||||
if (empty($name) || empty($email)) {
|
||||
echo json_encode(['success' => false, 'message' => 'Name and email required']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Save to file
|
||||
$data = [
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'phone' => $phone,
|
||||
'message' => $message,
|
||||
'date' => date('Y-m-d H:i:s')
|
||||
];
|
||||
|
||||
$file = __DIR__ . '/contacts.json';
|
||||
$existing = file_exists($file) ? json_decode(file_get_contents($file), true) : [];
|
||||
$existing[] = $data;
|
||||
file_put_contents($file, json_encode($existing, JSON_PRETTY_PRINT));
|
||||
|
||||
// Send Telegram notification
|
||||
$telegramToken = '8644418426:AAEL8GvHwohNDkxayu5yCZFPgh5Gsc-yAhA';
|
||||
$chatId = '382315644';
|
||||
$text = "📬 *New HP Contact Submission*\n\n" .
|
||||
"*Name:* $name\n" .
|
||||
"*Email:* $email\n" .
|
||||
"*Phone:* $phone\n" .
|
||||
"*Message:* $message";
|
||||
|
||||
$telegramUrl = "https://api.telegram.org/bot$telegramToken/sendMessage?chat_id=$chatId&text=" . urlencode($text) . "&parse_mode=Markdown";
|
||||
@file_get_contents($telegramUrl);
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Thank you! We will contact you soon.']);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'message' => 'Invalid request']);
|
||||
}
|
||||
Reference in New Issue
Block a user