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: Indepth on AI tools | 17 Relevance | 2 months ago | Eric Victor Chinedu | Building Online Tools | |
@husein @admin I keep getting the error of origin: 'null' has been blocked by cors policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with cors disabled. I have imputed this code snippet in my backend like you instructed in your awesome course, however, i keep getting the same error. // Add cors headers header('Access-Control-Allow-Origin: *'); // Allows all origins header('Access-Control-Allow-Methods: GET, POST ... | |||||
RE: Indepth on AI tools | 9 Relevance | 2 months ago | Husein Aboul Hasan | Building Online Tools | |
@google-ericvictorchinedu Since you're using a local wordpress site no need to add the cors policy lines of code. If you later on wanted to deploy it online then add them, but for the time being remove the cors section in your code and it should work. | |||||
RE: Create Custom Tools on WordPress training module > Test Your Ajax Function Error | 9 Relevance | 7 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 | 8 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: Indepth on AI tools | 5 Relevance | 2 months ago | Eric Victor Chinedu | Building Online Tools | |
Attachment : Complain pic 1.png This is the output, just '0'. @husein I removed the cors policy lines of code, @admin When i tried it with Visual Studio (Thunder Client), it worked fine Please what should i do? | |||||
RE: Error with 'Update the UI' | 5 Relevance | 3 months 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 months 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 | 5 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 | 5 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: Hosting fast API on VPS server | 5 Relevance | 6 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 | 8 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 | 9 Relevance | 8 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 ... | |||||
Small error in script.js in Connect The UI With The Snippet - Wrong action is invoked | 5 Relevance | 4 months 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: Create Custom Tools on WordPress training module > Test Your Ajax Function Error | 5 Relevance | 8 months ago | wiscochris | Points System | |
... API kep is correct - but it's not included below).and the snippet settings are: function openai_generate_text() { //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 // HASSAN check for balance $user_id = get_current_user_id(); $balance = mycred_get_users_balance($user_id); if ($balance < ... | |||||
RE: Error with 'Update the UI' | 5 Relevance | 3 months 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 ... |
Page 1 / 2
Next
Forum Information
Our newest member: abed
Latest Post: User role assignment.
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed