Forum in maintenance, we will back soon 🙂
Notifications
Clear all
Search result for: cors
Page 1 / 2
Next
# | Post Title | Result Info | Date | User | Forum |
RE: Create Custom Tools on WordPress training module > Test Your Ajax Function Error | 9 Relevance | 5 months ago | wiscochris | Points System | |
@ssadvisor when I deactivate the function as you suggested I still get the bad request error in VS code. here is the code (with xxx in place of the openai key) it's the exact same as provided here: per the instructions with the exception of adding cors header and updating the function name. any further insights would be appreciated. function openai_generate_text2 () { //Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed m ... | |||||
Hook generator trouble... | 9 Relevance | 5 months ago | Alfredo GIMBUTA | Building Online Tools | |
I followed all the step, in the video. Even I took your code. I verified my PHP function to connect to OpenAI and is working!! But when I got to java script I GOT STUCK I've added: " // Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methods header('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers " "// Add cors headersheader('Access-Control-Allow-Origin: *'); // Allows ... | |||||
RE: Youtube Title Generator from course gives error | 9 Relevance | 6 months ago | Appanna M | Building Online Tools | |
@husein Yes I did add the cors headers to the php. Not sure of which Javascript code you're talking about. function openai_generate_text() {// Add cors headersheader('Access-Control-Allow-Origin: *'); // Allows all originsheader('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methodsheader('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers// Get the topic from the AJAX request$topic = $_POST['topic'];$prompt = "Generate 5 youtube titles for a video about " . $topic;// OpenAI API URL ... | |||||
RE: Error with 'Update the UI' | 5 Relevance | 1 week ago | Patrick | Building Online Tools | |
... { // Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methods header('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers ////check if logged in //if (!is_user_logged_in()) { //wp_send_json("LOGIN_FIRST"); //} //check for balance //$user_id = get_current_user_id(); //$balance = mycred_get_users_balance($user_id); //if ($balance < 5) { ... | |||||
error with 'Connect The UI With The Snippet' | 5 Relevance | 3 weeks ago | Patrick | Building Online Tools | |
Hi Hassan, ive added the cors Headings to add to the PHP Code Snippet, but still get below error. Attachment : image.png | |||||
RE: Hook Generator Error | 5 Relevance | 2 months ago | Vladimir Ivanov | Building Online Tools | |
I posted the error I got above. It took some back and forth with Claude 3.5 Sonnet to fix it. Had to do with cors part of the code that was not being applied properly. | |||||
Hook Generator Error | 5 Relevance | 2 months ago | Vladimir Ivanov | Building Online Tools | |
Hi! I've followed all of the steps and added the 'CORS' code, however I'm still getting an error (attached) Attachment : Screenshot 2024-06-27 at 22.34.22.png Please help. Also, with the eqbin.com, I'm getting 200 (OK) message, but when I click on 'Send' again, I'd get a 400 (Bad Request) message. | |||||
RE: Error with 'Update the UI' | 5 Relevance | 3 weeks ago | Patrick | Building Online Tools | |
... the topic, hit generate, and nothing happened. no error messages, just nothing happened. Attachment : image.png Attachment : image.png this was the php snippet I copied from course: function openai_generate_text_basic() { // Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methods header('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers ////chec ... | |||||
RE: Hosting fast API on VPS server | 5 Relevance | 3 months ago | SSAdvisor | Building Online Tools | |
@dassa look at the info from this search: | |||||
RE: Create Custom Tools on WordPress training module > Test Your Ajax Function Error | 5 Relevance | 5 months ago | Husein Aboul Hasan | Points System | |
@wiscochris Add the following cors headers to your PHP snippet: header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methods header('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers It will look something like that in your code: Attachment : Screenshot 2024-04-07 131311.png | |||||
RE: Youtube Title Generator from course gives error | 5 Relevance | 6 months ago | Husein Aboul Hasan | Building Online Tools | |
@appanna-m Did you add the cors headings? Please show us your php and javascript codes | |||||
RE: Basic PHP Snippet to Generate Titles | 5 Relevance | 7 months ago | Hasan Aboul Hasan | Building Online Tools | |
I tested it from my side on deepdiveopenai, this is a security feature in the browser causing this. please add the following lines to the top of the function and try again: // Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methods header('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers | |||||
Small error in script.js in Connect The UI With The Snippet - Wrong action is invoked | 5 Relevance | 1 month ago | Rene Koch | Building Online Tools | |
... data.append('usage', usage); It is calling a different action, than we have created in our snippet: called openai_generate_text_basic If i replace in script.js the action name with openai_generate_text_basic it is working fine (after adding the cors headers). Have i missed a step? Keep up the excellent work! | |||||
RE: Building Online Tool errors. | 5 Relevance | 3 months ago | Sidney Guerra | Building Online Tools | |
Hey! Here goes: function openai_generate_text_basic() { // Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); // Specifies the allowed methods header('Access-Control-Allow-Headers: Content-Type, Authorization'); // Specifies the allowed headers // Get the topic from the AJAX request $topic = $_POST['topic']; $usage = $_POST['usage']; $prompt = "As an expert copywriter specialized in hook generation ... |
Page 1 / 2
Next
Forum Information
Our newest member: rifki
Latest Post: Indepth on AI tools
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed