Skip to content

Forum in maintenance, we will back soon 🙂

problem in placing ...
 
Notifications
Clear all

problem in placing code

18 Posts
3 Users
5 Reactions
647 Views
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

Hey guys am trying to place the php code on the code snippet after the one that mr Hasan had teach use in the video but after i run the am getting some error which i don't understand, please take a look at the image, it indecate the error

 
Posted : 09/19/2023 10:55 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

where is the image?

 
Posted : 09/20/2023 1:09 pm
SSAdvisor reacted
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

 here is the image sir

 
Posted : 09/20/2023 11:00 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

You need to rename the openai_generate_text function in you new code.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 09/21/2023 12:32 am
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

so i can replace it with anything right Example (openai_generate_story)

 
Posted : 09/21/2023 9:28 am
SSAdvisor reacted
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

@ola12ema yes, just change the name of the function

 
Posted : 09/21/2023 2:31 pm
SSAdvisor reacted
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

sir i don't know why am still getting this error undefined after i change the function, i didn't run the php code everywhere i get a short code and i paste the short code inside the page. and for the prompt this is how i set it

var prompt = `Generate a list of 10 domain name ideas for a website about ${topic}, and provide a brief explanation for each suggestion.`;
is there any mistake in it because i only change the prompt and the  function openai_generate_domain.
 
Posted : 09/22/2023 12:08 am
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

 
Posted : 09/22/2023 12:11 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@ola12ema there are many ways to debug PHP, here are a couple:

To start debugging in PHP, you can: 
Open Chrome and navigate to your index.php file.
Click the XDebug Helper extension and click the Debug option.
Open the script in the editor and press Alt Shift F9.
Set a breakpoint at each line where you want the debugger to pause.
Switch to the debug view.
Click the gear to bring up the languages menu.
Select PHP.
Reload the PHP server.
Press F5 to start the debugger.
You can also enable debugging mode in WordPress by accessing your cPanel or hPanel. 

 

---

To set debugging mode in PHP, you can use the following steps:

1. Open your PHP file in a text editor.
2. Look for the line that starts with `<?php`, which indicates the opening of a PHP script.
3. Add the following line of code before any other code:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

The `ini_set()` function is used to change the configuration settings at runtime. In this case, we are setting the `display_errors` and `display_startup_errors` settings to `1` to enable displaying errors, and the `error_reporting` setting to `E_ALL` to report all types of errors.

4. Save the file and run your PHP script again. Now, any errors or warnings will be displayed on the screen, helping you debug your code.

Note: It's important to remember to turn off debugging mode in a production environment to prevent sensitive information from being shown to users.

---

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 09/22/2023 12:54 pm
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

alright sir i'll try to do that

 
Posted : 09/22/2023 1:13 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

@ola12ema can you please change your display name here, as it is showing your email.

did you manage to get the first tool working?

 
Posted : 09/22/2023 2:06 pm
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

i've been on the debug for like 5hours now but still not working, any time i channge the function it'll still be giving the same error, i try to debug it from the cpanel, i couldn't mind to pay someone to do this for me 🤦

 

 
Posted : 09/22/2023 11:29 pm
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

@admin the first tools was working before, but it stoped working after i try to run the second one

This post was modified 1 year ago by Anonymous
 
Posted : 09/22/2023 11:31 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

@ola12ema it is just about the function name. make sure to change the name, and in the last two lines

 
Posted : 09/23/2023 4:15 am
(@Anonymous 1721)
Posts: 10
Active Member Guest
Topic starter
 

@admin should i leave the code snippet to run everywhere or i should get a short code and paste it in each page, i'll still try to place the code again, i'll give you feedback about it sir. Thanks for your response

 
Posted : 09/23/2023 10:04 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

keep it everywhere

 
Posted : 09/24/2023 7:45 am
(@Anonymous 6211)
Posts: 2
New Member Guest
 

Hello,

some thing wrong with your code

I am getting all the time "An error occurred: undefined"

Tried changing function name, same results

Some thing wrong with ajax its getting 400 (Bad Request)

Any ideas??

 

Best

 
Posted : 11/07/2023 10:09 pm
(@Anonymous 6211)
Posts: 2
New Member Guest
 

solved!

 
Posted : 11/08/2023 10:20 am
Share:
[the_ad_group id="312"]