
Build a ChatGPT web app with custom topic bots using PHP, MySQL and JavaScript, featuring a main page, topic-specific bots, a typing-effect chat, and code highlighting.
Install a local web server to run PHP and MySQL using Zam, enabling Apache and MySQL, and test at localhost/dashboard to build your first ChatGPT with custom bots.
Create folders for your web app, including assets, Ajax, and classes, add an index.php, and test locally on localhost to confirm the server prints hi world.
Download the source, copy the assets (images and css) into your my chatgpt folder, merge files, replace index html with php tags, then refresh to display a single chat bot.
Create a MySQL database and a bots table to store chat messages and bot data, including name, description, and role prompts, and learn to connect it to your PHP app.
Create a PHP class using PDO to connect to a local MySQL database, define a connect method, and test the connection by including class files and invoking the method.
Create a PHP chat class that connects to the database and exposes a get_chat_bots method. Use PDO to prepare, execute, and fetch results as objects from the boats table.
Display chat bots on the index page by looping through bot data with a PHP foreach loop, incrementing an index to vary images, and echoing each bot’s name and description.
Create a dedicated chat page to display recent chats and list chat bots, assign each bot an ID, and connect the page to the chat API for user conversations.
Implement a method to fetch bot data by id via a get request, using PDO to retrieve from the database and display the bot's welcome message.
Create a new chat table in phpMyAdmin for the my chat database with five columns (id, text, author enum user or AI, bought_id, created_at) to store and display messages.
Create a get chat method to fetch messages by boat ID, query the chat table, and display user and bot messages while hiding the welcome message when messages exist.
Create a JavaScript file that detects typing in a text input and sends the value to a PHP file on enter, wiring the input and boat ID.
Create two JavaScript functions to fetch and display user messages via Ajax, retrieving JSON data from a PHP file and updating the chat window.
Learn to implement a store messages function that sends an ajax post to a php script and inserts messages, with boat id and type, into the chat database.
Create a method to display AI messages with a loader while awaiting a response, using ajax post to get_response.php and render the AI reply from a prompt.
Download a third-party repository to connect to the ChatGPT API and send and receive messages. Install with Composer, include vendor/autoload.php, and use the repository class with your API token.
Sign up for a free OpenAI account on platform.openai.com, generate a secret API key, and paste it into your PHP file to access the OpenAI API.
Test the ChatGPT API by sending a user message from your app to the OpenAI SDK using GPT-3.5-turbo, and display the response as a chat message.
Store API responses and user messages in a database, format the conversation into a memory array with author labels, so the AI remembers the chat for smarter answers.
Create a method to extract and highlight code blocks from chat messages using a regular expression for triple backticks, identify the language, and render with Prism JS in PHP.
Create a get recent chat method to fetch the latest message per boat by joining the chat and boats tables with a subquery, then display 40-character previews.
Create a JavaScript function to auto-scroll the chat to the newest message using the main div's scroll height and jQuery animate, and disable the text area during responses.
Create a JavaScript typing effect function that reveals the AI message character by character, integrating with chat.php and the GPD API to simulate typing in the chat.
Create a JavaScript function to detect and highlight code blocks as you type, using triple backticks, extracting language, wrapping in pre and code, and reloading Prism for live syntax highlighting.
Set a system message to make ChatGPT follow a defined role and answer only topic-related questions (PHP, HTML, SQL) across PHP, HTML, and SQL boards in your bot.
In this course “Create your Own ChatGPT with Custom Bots Using PHP, MySQL JS”, you will learn how to develop or create your own ChatGPT clone but with the Chatbot features.
The bot can intelligently accurately respond to user queries within a specific Bot topic by meaning this bot will only answer questions related to the bot topic. We will also learn how to use ChatGPT AI with PHP, MySQL and JavaScript.
By taking this course you will gain the skills by building your own ChatGPT clone Website/Web-application that offers accurate answers. With PHP, MySQL, and JavaScript.
You can highlight the project you create in this course, If anyone who sees this project in your portfolio might want to hire you because from this course you will gain skills which will help you to learn to build and Create AI powered chatbot with with PHP, MySQL, using OpenAI's ChatGPT AI API.
Support
By taking this course you will get my full support. I've always loved to help my students (could be you). I’ve answered all that question that students have asked so far. I’m always in a ninja mood, if there’s a question it’ll be answered within a moment. By all this means if you have any errors. I'll be happy to check codes, errors.
This Course Covers The Following Features:
Build Custom Bots
Give role to ChatGPT AI to Follow
Build Bots that's Only answer Question Related to the Bots Topic
Highlight Code Snippet
Typing Effect like ChatGPT
Highlight Code Snippet while typing
Build a Chat to Display User and AI Messages and many more features
Please
look at all the lectures to see more things that are covered.