OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
genai
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/28/2024 11:03:35 AM
rwxrwxr-x
📄
article.php
997 bytes
05/19/2024 04:03:54 PM
rw-r--r--
📄
atri.php
6.15 KB
05/16/2024 03:58:00 AM
rw-r--r--
📄
bgenai_save.php
2.13 KB
06/22/2024 11:54:40 AM
rw-r--r--
📄
bizx.php
6.25 KB
05/16/2024 03:58:11 AM
rw-r--r--
📄
bprocess_genai.php
17.32 KB
08/22/2024 06:42:55 AM
rw-r--r--
📄
casudhi.php
6.59 KB
06/10/2024 05:09:43 AM
rw-r--r--
📄
creamai.php
12.81 KB
06/05/2024 11:58:31 PM
rw-r--r--
📄
gen2 copy.php
13.89 KB
05/21/2024 01:25:56 AM
rw-r--r--
📄
gen2.php
17.74 KB
06/12/2024 10:34:13 AM
rw-r--r--
📄
gen2_1.php
29.92 KB
06/15/2024 04:21:20 AM
rw-r--r--
📄
gen2_1_1.php
30.24 KB
06/14/2024 07:42:54 AM
rw-r--r--
📄
gen2_without_copytext.php
12.1 KB
05/19/2024 03:17:36 AM
rw-r--r--
📄
genai_article_save.php
1.6 KB
09/17/2024 07:46:25 AM
rw-r--r--
📄
genai_function.php
17.26 KB
09/17/2024 07:45:48 AM
rw-r--r--
📄
genai_save.php
2.13 KB
09/17/2024 07:45:57 AM
rw-r--r--
📄
gencv.php
6.84 KB
08/04/2024 12:04:57 PM
rw-r--r--
📄
gengraf.php
6.79 KB
05/18/2024 09:59:45 AM
rw-r--r--
📄
iamlucky.php
2.57 KB
05/09/2024 12:44:10 PM
rw-r--r--
📁
images
-
06/10/2024 05:06:33 AM
rwxr-xr-x
📄
index.html
3.9 KB
05/09/2024 06:09:07 AM
rw-rw-r--
📄
my_tts.sh
327 bytes
05/09/2024 10:11:32 AM
rwxrwxrwx
📄
netra.php
6.1 KB
05/16/2024 03:57:29 AM
rw-r--r--
📄
oai.sh
619 bytes
05/09/2024 10:37:43 AM
rw-r--r--
📄
old_gen2.php
13.54 KB
05/22/2024 02:35:21 PM
rw-r--r--
📄
old_genai_save.php
1.32 KB
05/22/2024 02:06:04 PM
rw-r--r--
📄
old_process_genai.php
5.77 KB
06/22/2024 04:08:45 AM
rw-r--r--
📄
process_genai.php
2.02 KB
09/17/2024 07:46:13 AM
rw-r--r--
📄
result.html
541 bytes
05/09/2024 06:09:07 AM
rw-rw-r--
📄
speech.mp3
67.97 KB
05/09/2024 10:30:50 AM
rw-r--r--
📄
submit_handler.php
2.78 KB
05/09/2024 11:53:47 AM
rw-r--r--
📁
team
-
05/21/2024 09:32:43 AM
rwxr-xr-x
📁
venv
-
05/09/2024 07:06:18 AM
rwxr-xr-x
Editing: submit_handler.php
Close
<?php // Enable error reporting error_reporting(E_ALL); ini_set('display_errors', 1); function content($text) { $pattern = '/```(.*?)```/'; $replacement = '$1'; $result = preg_replace($pattern, $replacement, $text); return $result; } function boldtext($text) { $pattern = '/\*\*(.*?)\*\*/'; $replacement = '<strong>$1</strong>'; $result = preg_replace($pattern, $replacement, $text); return $result; } // Check if the form was submitted if ($_SERVER["REQUEST_METHOD"] == "POST") { // // Check if required fields are present // if (!isset($_POST["headline"]) || !isset($_POST["objective"]) || !isset($_POST["target_grp"]) || !isset($_POST["keywords"]) || !isset($_POST["no_of_words"]) || !isset($_POST["typeofarticle"])) { // echo "Error: Required fields are missing."; // exit; // } // Retrieve form data $headline = $_POST["headline"]; $objective = $_POST["objective"]; $target_grp = $_POST["target_grp"]; $keywords = $_POST["keywords"]; $no_of_words = $_POST["no_of_words"]; $outline = $_POST["outline"] ?? ""; // Use default value if not set $primary_src = $_POST["primary_src"] ?? ""; // Use default value if not set $secondary_src = $_POST["secondary_src"] ?? ""; // Use default value if not set $typeofarticle = $_POST["typeofarticle"]; // Organize form data into an array $data = array( "headline" => $headline, "objective" => $objective, "target_grp" => $target_grp, "keywords" => $keywords, "typeofarticle" => $typeofarticle, "no_of_words" =>$no_of_words, "outline" => $outline, "primary_src" => $primary_src, "secondary_src" => $secondary_src ); // Encode form data as JSON $jsonstring = json_encode($data); <?php // Set your API key $apiKey = "sk-proj-FrlWqCTIyid7DZGorv0uT3BlbkFJzqrUB0km57kpp4aFPNV7"; // Set the endpoint URL $url = "https://api.openai.com/v1/completions"; // Set the request headers $headers = array( "Content-Type: application/json", "Authorization: Bearer $apiKey" ); // Set the request data // $data = array( // "prompt" => "Once upon a time", // "max_tokens" => 50 // ); // Initialize cURL $ch = curl_init(); // Set cURL options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Execute the request $response = curl_exec($ch); // Check for errors if(curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { // Print the response echo $response; } // Close cURL curl_close($ch); ?> ?>