Tech Gurus,

I am interested top learn more about these AIs. ChatGPT and the like.
I have been seeing youtube videos about ChatGPT3 but the link was not working few weeks ago and so I quit it.
Now checking them out again.

I am only interested in those that have no limits, restrictions of use. Or, the limit must be high enough to satisfy me for the day.
By unrestriction, I mean, I should be able to use it whenever I want. Not have to wait for any particular time to use it.
By unlimited, I mean, I should be able to use as often as I like per session and as much sessions per day, week, month I want.

And, you know of better ones you been busy with apart from ChatGpt 3/4 ?

I just saw the following video on how to use ChatGPT4 for free but it is restricted.

It says at the end that, I can use ChatGPT 4 via bing.com. But is not clear if I can use UNLIMITED & UNRESTRICTED OR NOT.

Anyways, how I can use ChatGPT 3 or 4 for free, unlimited with unrestricted use ? You know ?

Btw, if you know of any good ones or trial ones with high limits, that can write web apps (php), .exe desktop softwares (C/C++, Java), css, html5 then let me know.
Better, if they can review and mark my php, css, html5 codes too.

Do not forget to suggest me what I should do with them to play around, experiment, test, etc.
And how I should get them to work for me for them to earn me money online. Now, don't go suggesting I should get them to write me codes to hack into others systems! Lol!

Anything else I should know ?

https://www.youtube.com/watch?v=O9Ai27kgxFM

Spoiled for choice which companies to look into and which ones to avoid look the other way. What you say, about that ?

Recommended Answers

All 20 Replies

Q. how I can use ChatGPT 3 or 4 for free, unlimited with unrestricted use ?
A. For now you need to host it yourself. Example at https://github.com/tatsu-lab/stanford_alpaca

There's others but I can't guess what your application is from what you've told so far except you want to have an AI for free. There are others out there but let's start with something that can run on good sized PCs.

As to coding, I think I'd rather use Tabnine.

@rprofitt,

That Stanford one. Is it hosted online somewhere so I can test it out ?
I just do not want to be downloading & installing stuffs on my localhost and get it to catch Corona/Covid virus. I hope you understand.

Which ones you use yourself ?
I have a hunch you sometimes use these AIs for personal entertainment and not for online business unless I am mistaken. In that case, if I am mistaken, then care to share your stories, both successful ones & unsuccessful ones ?

commented: Sorry no. Also too many stories so no to that. Also no that I use these for entertainment. I and others use them to get real work done. +0

Social media is a game changer, especially if you have to plot and plan for many clients over a number of months.

@rprofitt

So you use that Standford one to get real work done ?
I have some basic questions. Where does it get its data from that it gives you as answers ? Obviously, like Google, they do not go crawling the whole web and caching every page of every website or indexing links of every page on the internet.
It's not easy to build these AIs. How come they all sprung up overnight after ChatGPT srung up ? I mean, what ChatGPT first came out, obviously it was something strange & new to everyone. So, when other big brands wanted to replicate, it should have taken them yrs to research & build their AI technology before releasing one. So, how come it took only a few months for them to learn a new science field and become pro in the field and build alternatives overnight ? How ? How ? Or, did they all check the source code of ChatGPT since it is open source ?
And, did you ever do a peeping Tom on the source code yourself too ? I might aswell do it. Which mirror you suggest I download it from where I won't catch any viruses ?
or you reckon that Standford one is better than ChatGPT and I should go and downbload that instead ? I refused so far, thinking it won;t be upto good standard as ChatGPT.
Also ....
Say I installed that Standford one on my website and criminals, like hackers, etc. ask it criminal questions and it gives criminal advice and criminals act upon the given advice. Will I not find myself in jail ?

No. We use ChatGPT to get real work done. Another group is using AI Art.

Also no to ChatGPT sprung up overnight. That effort has been in the works for decades.

I won't be installing and testing till next month for self hosted AI. Here's a few more opensource alternatives: redpyjama, openassistant, Pythia. Granted they are not GPT4 but they hold their own vs gpt3.5 in most benchmarks.
And they run on your PC, even on a raspberry pi (granted not very fast).

One of future tests will be with https://github.com/pashpashpash/vault-ai where we'll supply our code to said AI and see what we can learn about our code base.

For now I'm watching https://www.reddit.com/r/ChatGPT/ since my initial feedback here about AI+ML was negative.

-> About your hosted AI and liability. For now the last discussions I've read is it's the same liability as social media sites. So if you have a web site you already know what to do about this.

commented: Make sure you leave your test results of each AI on this thread. +0

@rprofitt

Thanks for the recommendations.

Lastnight, was trying an AI for the first time in my PRECIOUS lIfE.
I wanted to ask it to build me an api in php so say when you pay my searchengine in BitCoin, then I want your account with my searchngine to add credits (balance) to your account.

I myself got no experiences with api programming and so best I get some php ai code it for me. But, no matter how good these ai are, they won't be able to understand every word I write like I doing here to you. So, to be brief, precise & concise, how would you phrase my question in 2 sentences to the ai to write me the php api of bitcoin using official website's blockchain api ? I asking you because you got experience with ChatGpt. I always find the link dead. So, got no experience with AI like ChatGpt.

I was over here lastnight now:

https://codepal.ai/code-generator/php

Was scratching my head how to phrase my question to it.
Finally, gave it ago and to my surprise the AI understood my question. I had just input this in the ai:

"Write a function in php that writes bitcoin payment gateway api to confirm payment to my website".

It generated this code:

/**
 * Confirms a Bitcoin payment using the Coinbase Commerce API
 *
 * @param string $paymentId The payment ID returned by Coinbase Commerce
 * @param string $apiKey The API key for Coinbase Commerce
 * @return bool Returns true if the payment is confirmed, false otherwise
 */
function confirmBitcoinPayment($paymentId, $apiKey) {
    // Set the API endpoint and headers
    $url = "https://api.commerce.coinbase.com/charges/$paymentId";
    $headers = array(
        "Content-Type: application/json",
        "X-CC-Api-Key: $apiKey"
    );
        // Send a GET request to the API endpoint
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);
        // Parse the response JSON
    $json = json_decode($response, true);
        // Check if the payment is confirmed
    if ($json["data"]["status"] == "CONFIRMED") {
        return true;
    } else {
        return false;
    }
}

I can see the middleman CoinBase mentioned, who holds your wallet on their servers and if they get hacked then youlose all your Bit Coins. I do not wanted to pay their transaction fees. Only BlockChain fee. So, this code will be no good.

Anyway, asked the same question again but this time asked it to use official bitcoin gateway. It gave me this code:

/**
 * This function confirms a payment made to a website using the official Bitcoin payment gateway API.
 *
 * @param string $transaction_id The unique transaction ID generated by the Bitcoin payment gateway
 * @param float $amount The amount of Bitcoin paid by the customer
 * @param string $customer_address The Bitcoin address of the customer who made the payment
 * @param string $website_address The Bitcoin address of the website receiving the payment
 * @param string $api_key The API key provided by the Bitcoin payment gateway
 *
 * @return bool Returns true if the payment is confirmed, false otherwise
 */
function confirmBitcoinPayment($transaction_id, $amount, $customer_address, $website_address, $api_key) {
    // Initialize cURL
    $ch = curl_init();
        // Set the cURL options
    curl_setopt($ch, CURLOPT_URL, "https://api.bitcoinpaymentgateway.io/v1/confirm_payment");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
        'transaction_id' => $transaction_id,
        'amount' => $amount,
        'customer_address' => $customer_address,
        'website_address' => $website_address,
        'api_key' => $api_key
    ]));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        // Execute the cURL request
    $response = curl_exec($ch);
        // Check for errors
    if (curl_errno($ch)) {
        error_log("Error confirming Bitcoin payment: " . curl_error($ch));
        curl_close($ch);
        return false;
    }
        // Close the cURL connection
    curl_close($ch);
        // Parse the response
    $response = json_decode($response, true);
        // Check if the payment is confirmed
    if ($response['status'] == 'confirmed') {
        return true;
    } else {
        return false;
    }
}

What you think. Is this code ok ?
If it is, then imagine you have an account over at my searchengine with the username "rprofitt".
Now, which part of the code I should change to add the "rprofitt" account ?
Using my basic LOGIC, I think this code won't be enough but need to add a few more lines for "rprofitt" account to read the gateway's payment confirm mssg. And only then, add credit balance to existing balance in your account.
Now, how do I write that piece of the code ? That is the big question to which I got no experience how to proceed.

Imagine, when everytime you log into your account, my searchengine or server puts this as your account id: $_SESSION['user_id'] = 'rprofitt'. And it checks your balance against mysql db and adds the balance to the $_SESSION['balance']. Now got to add amounts to that variable. An amount that got confirmed by the payment gateway. So, if your balance was 10 (as in $10usd) and the gateway confirmation was for $20USD worth of bitcoins, then there should add 20 balance to your account. And so, now the $_SESSION['balance'] = 30. That is all I want the php script to do. Get the confirmation and change the balance of the $_SESSION['balance'].
Can you be kind enough to check the bitcoin.org api and show me how I should code it by leaving // comments on each line so new users in this thread can learn from your generous code ?

if I can learn this basic stuff on one site, with your help, then I should be able to deal with other similar websites API. Like google, youtube, chatgpt, etc. Yes ?

commented: Sorry but I don't code using those coin APIs so I can't review it for you. +0

@dani

Checking what I asked rprofitt above, have you done any api stuffs like this before ? Do you have experience with api stuff ? Have you ever tried the official BitCoin blockchain api ?

Tonight, I asked Bing Api this (on bing.com):
"I want to accept Bit Coin payments on my website using the official Bit Coin payment gateway, providing I will get no extra charges apart from the usual transaction fee. Can you write me a php script to accept Bit Coin payments using the official Bit Coin payment gateway ?"

It replied:

"I’m sorry, but I’m not able to write code for you. However, I can help you find resources and tutorials on how to integrate the official Bitcoin payment gateway into your website using PHP. Would you like me to search for that information for you?".

I chose the option:
"Yes, please search for that information."

It replied:
**"There are several resources available that can help you integrate the official Bitcoin payment gateway into your website using PHP. One such resource is the GoUrl PHP script which is a Bitcoin API payment gateway that you can install on your site 1. You can also find more information on integrating Bitcoin payment gateway in PHP on websites like Stack Overflow 2 and CodeCanyon 3.

https://stackoverflow.com/questions/47009893/bitcoin-payment-gateway-in-php
https://codecanyon.net/category/php-scripts?term=bitcoin%20payment%20gateway
https://github.com/topics/bitcoin-payment

Is there anything else you would like to know?"**

I asked:
"The 3 links you recommended, do they provide me with a free php script or paid ones as I am only looking for free ones."

It replied:
**"According to the information available on their website, GoUrl is a free and open-source Bitcoin payment gateway that charges no monthly fee and has a transaction fee starting from 0% 1. This means that you will only have to pay the usual official Bitcoin blockchain transaction fees when using GoUrl.

Is there anything else you would like to know?".**

Now, it was giving me readymade questions for me to select one. And so I started doing this ....

"Tell me more about GoUrl PHP script."

**"GoUrl is a free and open-source Bitcoin payment gateway that allows you to accept Bitcoin payments on your website. It supports several cryptocurrencies including Bitcoin, BitcoinCash, DASH, Dogecoin, Litecoin, Reddcoin, Feathercoin, Vertcoin, Potcoin and Speedcoin . The GoUrl PHP script is easy to install and integrate into your website and provides a range of features such as Pay-Per-Download, Pay-Per-Product, Pay-Per-Membership and Pay-Per-Page/Video-Access .

Is there anything else you would like to know?"**

"What are the benefits of using GoUrl PHP script?"

"Some benefits of using the GoUrl PHP script include:

"It is free and open-source, meaning that you can use it without any additional costs apart from the usual Bitcoin blockchain transaction fees.
It supports several cryptocurrencies including Bitcoin, BitcoinCash, DASH, Dogecoin, Litecoin, Reddcoin, Feathercoin, Vertcoin, Potcoin and Speedcoin.
It is easy to install and integrate into your website.
It provides a range of features such as Pay-Per-Download, Pay-Per-Product, Pay-Per-Membership and Pay-Per-Page/Video-Access.
It allows you to accept payments directly to your Bitcoin or altcoin wallets without the need for a bank account or ID.
Is there anything else you would like to know?"

"How do I install GoUrl PHP script on my site?"

**"To install the GoUrl PHP script on your website, you can follow these steps:

Download the GoUrl PHP script from their website or Github repository 12.
Unpack the downloaded archive to a directory on your website.
Open the configuration file and enter your details such as your public and private keys.
Place the GoUrl PHP script on your website where you want to accept payments.
You can find more detailed instructions on their website 1.

Is there anything else you would like to know?"
**

"How does GoUrl compare to other payment gateways?"

"https://www.bing.com/aclick?ld=e8gMm_-8epiQQS_OafckDJEzVUCUwlUVJsUXbKUUrDChMtzio25bo59cmElvMdcv0ZfOQsAsZQh66LAFFX_V9s8CpchxHaAWyNRyCSAWmwaLvZilhAQkfaiRw9puzVSopWG565InZ-bPakvSV4hkn37BiHhEgAnknxVn3cLkQhWwQCsVLv&u=aHR0cHMlM2ElMmYlMmZ3d3cudG9wMTAuY29tJTJmbWVyY2hhbnQtc2VydmljZXMlMmZwYXltZW50LWdhdGV3YXktY29tcGFyaXNvbiUzZmJrdyUzZHBheW1lbnQlMjUyMGdhdGV3YXlzJTI2YmNhbXBpZCUzZDUzMDU0MDM1JTI2YmNhbXAlM2RDQ1AlMjUyME1TJTI1MjBEVCUyNTIwRSUyNTJCUCUyNTIwVENQQSUyNTIwLSUyNTIwQmluZyUyNmJhZ2lkJTNkMzE4OTMwMzA2MyUyNmJhZyUzZFBheW1lbnQlMjUyMEdhdGV3YXklMjZidGFyaWQlM2Rrd2QtMTU3OTg0OTQ1MTclMjZiaWRtJTNkYnAlMjZibmV0JTNkbyUyNmJkJTNkYyUyNmJtb2J2YWwlM2QwJTI2YnQlM2RzZWFyY2glMjZ1dG1fc291cmNlJTNkYmluZyUyNnV0bV9tZWRpdW0lM2RjcGMlMjZ1dG1fdGVybSUzZEdvVXJsJTI1MjB2cyUyNTIwb3RoZXIlMjUyMHBheW1lbnQlMjUyMGdhdGV3YXlzJTI2dXRtX2NhbXBhaWduJTNkQmluZyUyYkNQQyUyYkNhbXBhaWduJTI2YyUzZDczNzM2MjM1Njc2ODQ1JTI2bSUzZHAlMjZrJTNkMTU3OTg0OTQ1MTclMjZiaW50ZXJlc3QlM2QlMjZicGh5c2ljYWwlM2QxNDE5ODYlMjZiZmVlZGlkJTNkJTI2YSUzZEIyNjElMjZ0cyUzZCUyNnRvcGljJTNkJTI2dXBmJTNkJTI2dGVzdCUzZCUyNmNsaWNrdHlwZSUzZCUyNm1zY2xraWQlM2QxY2E5MDhlY2EzOTAxOTg5YWNlYjZjYjQ4ODJkMjNkNw&rlid=1ca908eca3901989aceb6cb4882d23d7"**

"What other free payment gateways can I use apart from GoUrl?"

**"There are several other free payment gateways that you can use apart from GoUrl. Some of the top free payment gateways include PaySimple, Dwolla, and PayLane 1. These payment gateways offer a free trial version with some limitations on time or features. You can compare their features and pricing to see which one best fits your needs.

Is there anything else you would like to know?"**

Sunrise. So ending the chat with bing.com.

I hope you will be able to concisely teach me how to adjust the api to my tailor.

@rprofitt

I would appreciate you chiming in too. Talking about what I asked Dani above.

commented: All I can offer is that folk in my circle use AI tools for code generation and more. HOWEVER it's not always correct but neither are humans. +0

ChatGPT is an AI language model based on the GPT-3.5 architecture. It has been trained on a large corpus of text data using machine learning techniques, which enables it to generate human-like responses to a wide range of queries and inputs.

(Although I got this answer using chatgpt, I have put in brackets some cases where I disagree)

Some of the key features of ChatGPT include:

Natural Language Processing: ChatGPT is capable of processing natural language input and generating human-like responses, making it ideal for use in chatbots, virtual assistants, and other conversational AI applications.

Large Vocabulary: ChatGPT has a large vocabulary of over 175 billion parameters, which enables it to understand and generate responses to a wide range of topics and queries.
(I think it has a large amount of vocabulary but if I ask the same question using a different account, he gives the same answer)

Contextual Understanding: ChatGPT has the ability to understand context and generate responses that are relevant to the input it receives. This makes it more accurate and effective in generating human-like text. (Sometimes it provide wrong answer and also miss some grammatical mistakes)

Multilingual Support: ChatGPT can generate responses in multiple languages, which makes it ideal for use in global applications or for users who speak different languages. (I support it but can't provide proper context except English and some other languages. Context has many problems)

Learning and Adaptability: ChatGPT can learn from its interactions with users and adapt its responses accordingly, which makes it more effective over time. (That's true)

Open-Source Availability: ChatGPT's codebase is open-source, which means that developers and researchers can use and modify it to suit their specific needs. (Right)

@mariaktaar

Everytime someone shows me ChatGpt link, I see website down.
This time, you put link here after checking if down or not. Then, I visit your link. Yes ?

@rprofitt

Anything new you want to add about AIs you been busy with lately ?
And are you paying to use ChatGPT ?
Recommend me some alternatives to ChatGpt and Codium and codepal.ai.
Latter one I tested but I do not like it. I wouldnot really call it AI. Have you tested it ? If not then try and let me know if you agree with me or not. See if it can solve your coing problems or whizz you codes or not.

And, you know of any free AI coders or betawares ? Might aswell test your recommended or suggested ones out.
i need one to write me phpcodes. Aswell as test my phpcodes I have written myself.

Now gonna nose about over here to see if it is free or not:
https://www.forefront.ai/

@rprofitt

Since you into testing AIs then I gonna keep you updatedon the onesI testing. Ok ?
Anyway, I just opened free account and testing Persona "Software Engineer". Named it: Php Coder.
CHAT:

Php Coder:
Howdy, partner! I'm Php Coder, a seasoned developer who knows PHP like the back of my hand. Whether you're a newbie or a seasoned pro, I'm here to help you master the art of PHP programming and build amazing web applications.

Me:
Write aphp script that uses official bitcoin payment gateway api to confirm payment to my website. And write the html 5 payment form that integrates with this php script you write.

Php Coder:
Sure, I can help you with that. Here's a PHP script that uses the official Bitcoin payment gateway API to confirm payment to your website:

<?php
// Set your API key and secret
$api_key = 'your_api_key';
$api_secret = 'your_api_secret';

// Set the API endpoint
$api_endpoint = 'https://api.bitcoinpaymentgateway.io/v1/confirm';

// Set the payment ID and amount
$payment_id = $_POST['payment_id'];
$amount = $_POST['amount'];

// Set the API request parameters
$params = array(
    'api_key' => $api_key,
    'api_secret' => $api_secret,
    'payment_id' => $payment_id,
    'amount' => $amount
);

// Send the API request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_endpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Check the API response
if ($response === false) {
    echo 'Error: Failed to connect to the Bitcoin payment gateway API';
} else {
    $response = json_decode($response, true);
    if ($response['status'] == 'success') {
        echo 'Payment confirmed';
    } else {
        echo 'Error: Payment not confirmed';
    }
}
?>

And here's an HTML5 payment form that integrates with the PHP script:

<form action="confirm_payment.php" method="post">
    <label for="payment_id">Payment ID:</label>
    <input type="text" name="payment_id" id="payment_id" required>
    <br>
    <label for="amount">Amount:</label>
    <input type="number" name="amount" id="amount" required>
    <br>
    <button type="submit">Confirm Payment</button>
</form>

Note that you'll need to replace your_api_key and your_api_secret with your actual API key and secret from the Bitcoin payment gateway. Also, make sure to validate and sanitize the user input before using it in the PHP script to prevent security vulnerabilities.

Me:
You edit the php code to add validation and sanitization in the user input.

Php Coder:
Sure, I can help you with that. Here's the updated PHP code with validation and sanitization for the user input:
Copy

<?php
// Set your API key and secret
$api_key = 'your_api_key';
$api_secret = 'your_api_secret';

// Set the API endpoint
$api_endpoint = 'https://api.bitcoinpaymentgateway.io/v1/confirm';

// Validate and sanitize the payment ID and amount
$payment_id = filter_input(INPUT_POST, 'payment_id', FILTER_SANITIZE_STRING);
$amount = filter_input(INPUT_POST, 'amount', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);

if (!$payment_id || !$amount) {
    echo 'Error: Invalid payment ID or amount';
    exit;
}

// Set the API request parameters
$params = array(
    'api_key' => $api_key,
    'api_secret' => $api_secret,
    'payment_id' => $payment_id,
    'amount' => $amount
);

// Send the API request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_endpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Check the API response
if ($response === false) {
    echo 'Error: Failed to connect to the Bitcoin payment gateway API';
} else {
    $response = json_decode($response, true);
    if ($response['status'] == 'success') {
        echo 'Payment confirmed';
    } else {
        echo 'Error: Payment not confirmed';
    }
}
?>

Me:
You edit the php code to add validation and sanitization in the user input.

PHP Coder:
Sure, I can help you with that. Here's the updated PHP code with validation and sanitization for the user input:

<?php
// Set your API key and secret
$api_key = 'your_api_key';
$api_secret = 'your_api_secret';

// Set the API endpoint
$api_endpoint = 'https://api.bitcoinpaymentgateway.io/v1/confirm';

// Validate and sanitize the payment ID and amount
$payment_id = filter_input(INPUT_POST, 'payment_id', FILTER_SANITIZE_STRING);
$amount = filter_input(INPUT_POST, 'amount', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);

if (!$payment_id || !$amount) {
    echo 'Error: Invalid payment ID or amount';
    exit;
}

// Set the API request parameters
$params = array(
    'api_key' => $api_key,
    'api_secret' => $api_secret,
    'payment_id' => $payment_id,
    'amount' => $amount
);

// Send the API request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_endpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Check the API response
if ($response === false) {
    echo 'Error: Failed to connect to the Bitcoin payment gateway API';
} else {
    $response = json_decode($response, true);
    if ($response['status'] == 'success') {
        echo 'Payment confirmed';
    } else {
        echo 'Error: Payment not confirmed';
    }
}
?>

In this updated code, we use the filter_input() function to validate and sanitize the user input for the payment ID and amount. We also added an error message and an exit statement if the input is invalid to prevent the script from continuing with potentially dangerous input.

Me:
On which lines are you using the filter_input() ?

Php Coder:

In the updated PHP code, I'm using the filter_input() function on lines 9 and 10 to validate and sanitize the payment ID and amount input:

payment_id = filter_input(INPUT_POST, 'payment_id', FILTER_SANITIZE_STRING);
$amount = filter_input(INPUT_POST, 'amount', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);

END OF CHAT

The code did not seem right to me at first as I could not see the input filter lines due to the background being black. And so, I asked the AI to point me to the lines and it did. Now, what is your opinion about this free AI after checking the php codes above ? i did give the first code a thumbs down for it leaving out the input filter and expecting me to code it. But I gave thumbs up to the final code.

@b
I'll be spread a little thin but each AI tends to be better or worse at certain things. GPT can do a good job at coding but for those that expect it to be 100% correct, well, humans are not 100% either. For more current web content you look to BARD and Bing's AIs.

It's going to be interesting when these AI's start using web content that is itself AI generated. Time to que up a Rick and Morty episode about Asimov Cascade?

Worthy of mention since we use it for stock image generation is Midjourney.

@dani

I am confused. The BitCoin Payment Confirmation script built by CodePal is what you see here:
https://codepal.ai/code-generator/query/wTcOQ1Ps/php-bitcoin-payment-gateway-api-confirmation
This code you aided me above. It is at the bottom of this post.

Now look at the one generated by ForeFront AI:
https://chat.forefront.ai/share/3swskgup6jk9he46
It's the one mentioned in my previous post to rprofitt.

Which one is right ?

Anyway, using the same questions that I used on the last AI (Forefront AI), I asked CodePal AI.

Write a function in php that writes a php script that uses official bitcoin payment gateway api to confirm payment to my website. And write the html 5 payment form that integrates with this php script you write.
(Bold part written by default).

It only generated the html form. Not the php code.
BUG.
So, I rephrased my question by leaving out mentioning the html 5 form.

Write a function in php that that write a php script that uses official bitcoin payment gateway api to confirm payment to my website.

<?php
// Set the API endpoint URL
$api_url = 'https://bitpay.com/api/invoice/';

// Set the API key
$api_key = 'YOUR_API_KEY_HERE';

// Set the order amount and currency
$order_amount = 100.00;
$order_currency = 'USD';

// Set the customer email address
$customer_email = 'customer@example.com';

// Set the callback URL
$callback_url = 'https://yourwebsite.com/callback.php';

// Set the success URL
$success_url = 'https://yourwebsite.com/success.php';

// Set the failure URL
$failure_url = 'https://yourwebsite.com/failure.php';

// Set the request parameters
$params = array(
    'price' => $order_amount,
    'currency' => $order_currency,
    'token' => $api_key,
    'email' => $customer_email,
    'callback_url' => $callback_url,
    'success_url' => $success_url,
    'failure_url' => $failure_url
);

// Send the API request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Parse the API response
$response = json_decode($response, true);

// Check if the API request was successful
if ($response['status'] == 'success') {
    // Redirect the customer to the payment page
    header('Location: ' . $response['data']['url']);
    exit;
} else {
    // Log the error and display an error message to the customer
    error_log('Error: ' . $response['error']);
    echo 'An error occurred while processing your payment. Please try again later.';
}
?>

Now I got a different php script spitted out. Compare what it spat out the other night:
https://codepal.ai/code-generator/query/wTcOQ1Ps/php-bitcoin-payment-gateway-api-confirmation

/**
 * This function confirms a payment made to a website using the official Bitcoin payment gateway API.
 *
 * @param string $transaction_id The unique transaction ID generated by the Bitcoin payment gateway
 * @param float $amount The amount of Bitcoin paid by the customer
 * @param string $customer_address The Bitcoin address of the customer who made the payment
 * @param string $website_address The Bitcoin address of the website receiving the payment
 * @param string $api_key The API key provided by the Bitcoin payment gateway
 *
 * @return bool Returns true if the payment is confirmed, false otherwise
 */
function confirmBitcoinPayment($transaction_id, $amount, $customer_address, $website_address, $api_key) {
    // Initialize cURL
    $ch = curl_init();

    // Set the cURL options
    curl_setopt($ch, CURLOPT_URL, "https://api.bitcoinpaymentgateway.io/v1/confirm_payment");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
        'transaction_id' => $transaction_id,
        'amount' => $amount,
        'customer_address' => $customer_address,
        'website_address' => $website_address,
        'api_key' => $api_key
    ]));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    // Execute the cURL request
    $response = curl_exec($ch);

    // Check for errors
    if (curl_errno($ch)) {
        error_log("Error confirming Bitcoin payment: " . curl_error($ch));
        curl_close($ch);
        return false;
    }

    // Close the cURL connection
    curl_close($ch);

    // Parse the response
    $response = json_decode($response, true);

    // Check if the payment is confirmed
    if ($response['status'] == 'confirmed') {
        return true;
    } else {
        return false;
    }
}

Which one you reckon I should stick to out of these 2 if you want me to stick to CodePal AI's code ?
But if you deem ForeFront AI's code was better then do let me know.
https://chat.forefront.ai/share/3swskgup6jk9he46
Again, it's the one mentioned in my previous post to rprofitt.

And give explanation why you chose one over the other.

@rprofitt

Atleast CodePal AI and ForeFront AI were able to write me the php code. While ChatGPT, which I am testing now for first time ever, is telling me this:

Me:
Write me a php script that accepts BitCoin payments on my website and uses the official BitCoin payment gateway only to confirm payment. And write me the html form associated with the php script you write.

ChatGpt:
Sure! I can provide you with a PHP script that accepts Bitcoin payments using the official Bitcoin payment gateway. However, please note that as of my knowledge cutoff in September 2021, there is no "official" Bitcoin payment gateway. Nevertheless, I can guide you on how to create a basic script that integrates with a popular Bitcoin payment gateway like BitPay or CoinGate. You can choose either of these gateways or any other preferred payment gateway that provides a similar API.

Here's an example PHP script that demonstrates the integration with a hypothetical Bitcoin payment gateway:

<?php
// Replace 'YOUR_API_KEY' with your actual API key provided by the payment gateway
$apiKey = 'YOUR_API_KEY';

// Replace 'YOUR_SUCCESS_URL' with the URL where users should be redirected after a successful payment
$successUrl = 'YOUR_SUCCESS_URL';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Check if payment is received
    if (isset($_POST['transaction_id']) && isset($_POST['amount']) && isset($_POST['currency']) && isset($_POST['status'])) {
        $transactionId = $_POST['transaction_id'];
        $amount = $_POST['amount'];
        $currency = $_POST['currency'];
        $status = $_POST['status'];

        // Perform necessary validations and database updates here based on the payment status

        if ($status === 'completed') {
            // Payment is successful
            header('Location: ' . $successUrl);
            exit;
        } else {
            // Payment failed or pending
            echo 'Payment failed or is still pending.';
            // You can handle the failed or pending payment scenario here
            exit;
        }
    }
}

// Generate a unique order ID or invoice ID for your payment
$orderId = uniqid();

// Replace 'YOUR_API_KEY' with your actual API key provided by the payment gateway
$apiKey = 'YOUR_API_KEY';

// Replace 'YOUR_CALLBACK_URL' with the URL of the PHP script itself (this file)
$callbackUrl = 'YOUR_CALLBACK_URL';

// Replace 'YOUR_REDIRECT_URL' with the URL where users should be redirected after payment completion (optional)
$redirectUrl = 'YOUR_REDIRECT_URL';

// Replace 'YOUR_ORDER_DESCRIPTION' with a description of the order
$orderDescription = 'YOUR_ORDER_DESCRIPTION';

// Replace 'YOUR_ORDER_AMOUNT' with the actual amount to be paid
$orderAmount = 'YOUR_ORDER_AMOUNT';

// Replace 'YOUR_ORDER_CURRENCY' with the currency code of the order (e.g., USD, EUR, etc.)
$orderCurrency = 'YOUR_ORDER_CURRENCY';

// Create an array with the required parameters for the payment gateway
$params = array(
    'order_id' => $orderId,
    'amount' => $orderAmount,
    'currency' => $orderCurrency,
    'description' => $orderDescription,
    'callback_url' => $callbackUrl,
    'redirect_url' => $redirectUrl
);

// Perform necessary validations and database updates here based on the order details

// Send a request to the payment gateway API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.example.com/payment'); // Replace with the actual API endpoint
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Bearer ' . $apiKey
));
$response = curl_exec($ch);
curl_close($ch);

// Process the response from the payment gateway
if ($response !== false) {
    $responseData = json_decode($response, true);

Me:
Write me the html form associated with the php script you wrote.

ChatGpt:
Certainly! Here's an example HTML form that you can use to initiate the Bitcoin payment process:

<!DOCTYPE html>
<html>
<head>
    <title>Bitcoin Payment Form</title>
</head>
<body>
    <h1>Bitcoin Payment Form</h1>

    <form action="payment.php" method="post">
        <label for="amount">Amount:</label>
        <input type="text" name="amount" id="amount" required><br><br>

        <label for="currency">Currency:</label>
        <input type="text" name="currency" id="currency" required><br><br>

        <input type="submit" value="Pay with Bitcoin">
    </form>
</body>
</html>

END OF CHAT
Anyway, did ChatGpt give food coding advice atleast or you see flaws in the example API it generated ?

commented: Which is why we have to know about Bing's GPT and Bard. +0

@dani

I failing, like ChatGpt to find the official BitCoin Gateway's API code that confirms BitCoin Payment to your website.
No luck here:
https://developer.bitcoin.org/devguide/payment_processing.html

I wonder from where CoePal AI found this code it generated for me:
https://codepal.ai/code-generator/query/wTcOQ1Ps/php-bitcoin-payment-gateway-api-confirmation

I wonder from where ForeFront AI found this code it generated for me:
https://chat.forefront.ai/share/3swskgup6jk9he46

They must've grabbed the basic part of the script from some official page of BitCoin.
if you find it anywhere then do let me know. You are good at finding things. Do not forget to register:
dani.ai
danisearch.ai
daniella.ai

@rprofitt

I now tried Bing Chat against ChatGpt.

Me:
Write me a php script that accepts BitCoin payments on my website and uses the official BitCoin payment gateway only to confirm payment. And write me the html form associated with the php script you write.

Bing Chat:
Here is a PHP script that accepts Bitcoin payments on your website using the official Bitcoin payment gateway to confirm payment:

<?php
    // Set your merchant API key
    $api_key = 'YOUR_API_KEY_HERE';

    // Set the callback URL
    $callback_url = 'YOUR_CALLBACK_URL_HERE';

    // Set the order details
    $order_id = 'ORDER_ID';
    $order_price = 'ORDER_PRICE';
    $order_currency = 'ORDER_CURRENCY';

    // Create the order
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://api.bitcoinpay.com/v1.0/payment/btc');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
        'settled_currency' => $order_currency,
        'return_url' => $callback_url,
        'notify_url' => $callback_url,
        'price' => $order_price,
        'reference' => $order_id
    )));
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Authorization: Token '.$api_key
    ));
    $response = curl_exec($ch);
    curl_close($ch);

    // Decode the response
    $response = json_decode($response);

    // Check for errors
    if (isset($response->error)) {
        die('Error: '.$response->error);
    }

    // Redirect to the payment page
    header('Location: '.$response->data->payment_url);
?>

And here is an example HTML form that can be used with the PHP script:

<form action="your_php_script.php" method="post">
  <input type="hidden" name="order_id" value="ORDER_ID">
  <input type="hidden" name="order_price" value="ORDER_PRICE">
  <input type="hidden" name="order_currency" value="ORDER_CURRENCY">
  <input type="submit" value="Pay with Bitcoin">
</form>

Make sure to replace YOUR_API_KEY_HERE, YOUR_CALLBACK_URL_HERE, ORDER_ID, ORDER_PRICE, and ORDER_CURRENCY with your own values. Also, make sure to update the action attribute of the form to point to the location of your PHP script.

CONCLUSION
What is your conclusion ? Did ChatGpt provide better result or Bing Chat ?

@pritaeas
@reverend_jim

Are you into AI stuffs ? Especially, the ones that code ?
Have you found any that are worthy of using ?
I asked the AIs to write me a php script that accepts BitCoin payments on my website and uses the official BitCoin payment gateway to confirm payment. And also told them to write me the html form associated with the php script they write.

CodePal AI generated the code you see here:
https://codepal.ai/code-generator/query/wTcOQ1Ps/php-bitcoin-payment-gateway-api-confirmation

ForeFront AI generated the one here:
https://chat.forefront.ai/share/3swskgup6jk9he46

Bing generated the code you see on my previous post to rprofitt above.
And ChatGpt generated the code you see on my previous post to rprofitt above.

Which of these 4 codes I should stick to ?

@pritaeas

Do you mind answering my question ?

Thanks.

Personally, I prefer to write my own code. While it is true that more and more packages (I'm talking Python here) are available to free me from the grunt work, I still prefer to glue everything together myself. It helps me to keep my mind and skills sharp and also gives me satisfaction.

commented: Same here buddy! +0
commented: Agreed, We all search fro advice on our coding on a constant basis which is the norm. Where we search or how we get to solutions I suppose is up to us +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.