OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
knoblyExpressLandingPage
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/28/2024 11:03:35 AM
rwxrwxr-x
📄
about.php
2.06 KB
08/21/2024 10:01:12 AM
rw-r--r--
📁
assets
-
08/21/2024 10:01:17 AM
rwxr-xr-x
📄
blog.php
5.35 KB
08/21/2024 10:01:12 AM
rw-r--r--
📄
chatbot.html
1.86 KB
08/21/2024 10:01:12 AM
rw-r--r--
📄
chatbot.php
1.3 KB
08/21/2024 10:01:12 AM
rw-r--r--
📄
dashboard.php
788 bytes
08/21/2024 10:01:12 AM
rw-r--r--
📄
db.php
378 bytes
08/21/2024 10:01:12 AM
rw-r--r--
📄
footer.html
4.3 KB
08/21/2024 10:01:12 AM
rw-r--r--
📄
forgot-password-handler.php
7.12 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
forgot-password.php
4.52 KB
08/21/2024 10:01:13 AM
rw-r--r--
📁
includes
-
08/21/2024 10:01:14 AM
rwxr-xr-x
📄
index.php
12.59 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
login-handler.php
3.7 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
login.php
4.72 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
navbar.php
1.14 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
refundPolicy.php
5.99 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
reset-password-handler.php
4.01 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
reset-password.php
2.95 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
service.php
4.29 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
signup-handler.php
1.04 KB
08/21/2024 10:01:13 AM
rw-r--r--
📄
signup.php
5.98 KB
08/21/2024 10:01:14 AM
rw-r--r--
📄
usagePolicy.php
15.21 KB
08/21/2024 10:01:14 AM
rw-r--r--
📁
vendor
-
08/21/2024 10:01:26 AM
rwxr-xr-x
Editing: chatbot.php
Close
<?php header('Content-Type: application/json'); $input = json_decode(file_get_contents('php://input'), true); $message = $input['message'] ?? ''; if ($message) { // Set up the OpenAI API $apiUrl = 'https://api.openai.com/v1/chat/completions'; $apiKey = 'sk-proj-FrlWqCTIyid7DZGorv0uT3BlbkFJzqrUB0km57kpp4aFPNV7'; // Set up the data to send $data = [ 'model' => 'gpt-3.5-turbo', 'messages' => [ ['role' => 'user', 'content' => $message] ], 'max_tokens' => 100, ]; // Use cURL to make the API request $ch = curl_init($apiUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $apiKey ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); curl_close($ch); // Parse and return the response $apiResponse = json_decode($response, true); $botMessage = $apiResponse['choices'][0]['message']['content'] ?? 'Sorry, something went wrong.'; echo json_encode(['choices' => [['message' => ['content' => $botMessage]]]]); } else { echo json_encode(['error' => 'No message sent.']); }