Entradas

Mostrando entradas de marzo, 2024

BUSCAR CallAPIJavaScript CHATGPT

  Aquí tienes el código para implementar un formulario de búsqueda por nombre utilizando el método POST en index.php, así como una adaptación en api_json.php para manejar la búsqueda: index.php: html Copy code <!DOCTYPE html> <html lang="es"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Buscar Productos</title> </head> <body> <form id="searchForm">     <input type="text" name="searchTerm" id="searchTerm" placeholder="Nombre del producto">     <button type="submit">Buscar</button> </form> <div id="lista"></div> <script>     const form = document.getElementById('searchForm');     form.addEventListener('submit', function(event) {         event.preventDefault();         const searchTerm = doc...

REDUCIR Y CONVERTIR IMAGEN 800X600 FORMATO WEBP CON PHP

  Como reducir resolucion con php a 800 x 600 px que funcion usar paea un ejemplo simple Para reducir la resolución de una imagen a 800 x 600 píxeles con PHP, puedes usar la función imagecreatetruecolor para crear una nueva imagen con las dimensiones deseadas y luego copiar la parte redimensionada de la imagen original a la nueva. Aquí hay un ejemplo simple de cómo hacerlo: PHP <?php // Carga la imagen original $imagen_original = imagecreatefromjpeg("imagen_original.jpg"); // Obtener el ancho y alto de la imagen original $ancho_original = imagesx($imagen_original); $alto_original = imagesy($imagen_original); // Calcular las nuevas dimensiones $nuevo_ancho = 800; $nuevo_alto = 600; // Crear una nueva imagen con las dimensiones deseadas $imagen_redimensionada = imagecreatetruecolor($nuevo_ancho, $nuevo_alto); // Copiar la parte redimensionada de la imagen original a la nueva imagecopyresampled($imagen_redimensionada, $imagen_original, 0, 0, 0, 0, $nuevo_ancho, $nuevo_alto, $...

build a CRUD Operation using PHP & MongoBD este ver

  build a CRUD Operation using PHP & MongoBD https://morioh.com/a/3264375fd68d/build-a-crud-operation-using-php-and-mongobd#google_vignette Using this example you can easily use mongodb query like find, select, insert, update, delete, search etc in php. also you can learn how to make connection between php and mongodb. As we know mongodb is a very popular open source, document based NoSQL database. if you have large number of data or if it can become more data on database then you should use Mongodb as database. Mongodb is a document based NoSQL database that way it store data in less memory and you can fetch quick records. So, you need to just follow bellow step and will get full example of crud application. you can also download full script in free. But make sure you need to install mongodb and composer in your system. Step 1: Create MongoDB database First thing is, we require to create mongodb database and books collection. So successful MongoDB installation open the termina...

CRUD Operation using PHP & Mongodb

  CRUD Operation using PHP & Mongodb https://www.javatpoint.com/crud-operation-using-php-and-mongodb In this section, we are going to perform view, insert, delete and update operations. We will use PHP and Mongodb to do this. The database which we used in our application is MongoDB. The step-by-step process to create, update, delete modules is described as follows. In PHP, the various operation of MongoDB can be easily used by the given example, like update, add, find, search, delete, select, etc. The connection between MongoDB and PHP will also be learned in this example. The open-source and very famous database is MongoDB. It is a NoSQL database that is based on the document. We will use the MongoDB database in our application if the database has more data or it contains a large number of data. MongoDB database stores data by using less memory, and it can also be used to fetch quick records. The steps to do this are described as follows: Step 1 In this step, we are going to C...