Posts

how to upload csv file on database with php

how to upload csv file on database with php  <?php   if(isset($_POST["submit"])) {  if($_FILES['file']['name'])  {   $filename = explode(".", $_FILES['file']['name']);   if($filename[1] == 'csv')   {    $handle = fopen($_FILES['file']['tmp_name'], "r");    while($data = fgetcsv($handle))    {     $item1 = mysqli_real_escape_string($conn, $data[0]);                   $item2 = mysqli_real_escape_string($conn, $data[1]); $item3 = mysqli_real_escape_string($conn, $data[2]);                   $item4 = mysqli_real_escape_string($conn, $data[3]); $item5 = mysqli_real_escape_string($conn, $data[4]);                   $item6 = mysqli_real_escape_string($conn, $data[5]); $item7 = mysqli_real_escape_string($conn, $data[6]);  $item8 = mysqli_real_esc...

How to Upload File in CodeIgniter

Image
  /////create a tabel  CREATE TABLE ` users ` ( `id` int ( 11 ) NOT NULL AUTO_INCREMENT, `name` varchar ( 100 ) COLLATE utf8_unicode_ci NOT NULL , `email` varchar ( 255 ) COLLATE utf8_unicode_ci NOT NULL , `picture` varchar ( 255 ) COLLATE utf8_unicode_ci NOT NULL , `created` datetime NOT NULL , `modified` datetime NOT NULL , `status` tinyint ( 1 ) NOT NULL DEFAULT '1' COMMENT '1=Active, 0=Inactive' , PRIMARY KEY ( `id` ) ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; Controller (Users.php): <?php defined ( 'BASEPATH' ) OR exit( 'No direct script access allowed' ); class  Users  extends  CI_Controller {     function   __construct () {          parent :: __construct ();          $this -> load -> model ( 'user' );     }      ...

Mastering Email Validation in JavaScript with onchange Event: A Comprehensive Guide

  Mastering Email Validation in JavaScript with onchange Event: A Comprehensive Guide <input type="email" id="emailInput" onchange="validateEmail()"> <span id="emailError" style="color: red;"></span> <script> function validateEmail() { const emailInput = document.getElementById("emailInput"); const emailError = document.getElementById("emailError"); const emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if (!emailPattern.test(emailInput.value)) { emailError.textContent = "Invalid email format"; } else { emailError.textContent = ""; } } </script>

Use EJS as Template Engine in Node.js Use EJS as Template Engine in Node.js Use EJS as Template Engine in Node.js

  Use EJS as Template Engine in Node.js Use EJS as Template Engine in Node.js Use EJS as Template Engine in Node.js Use EJS as Template Engine in Node.js  /////////////////////////////// //////////////////////////////////////////// command line npm install ejs etemp.js // Set express as Node.js web application // server framework. // To install express before using it as // an application server by using // "npm install express" command. const express = require ( 'express' ); const app = express (); // Set EJS as templating engine app . set ( 'view engine' , 'ejs' ); app . get ( '/' , ( req , res ) => {       // The render method takes the name of the html     // page to be rendered as input.     // This page should be in views folder       // in the root directory.     let data = {         name : 'Akashdeep' ,         hobbies : [ 'playing football' , 'playing che...

how to create node js page with html

///////////////command line install for express////////////// ////////////express.js////////////// const express = require ( 'express' );  npm install express   const app = express ( '' ); app . get ( '' ,( req , res ) => { res . send ( 'Hello,this is home page' ); }); app . get ( '/about' ,( req , res ) => { res . send ( 'hello this is about page' ); }); app . listen ( 5000 ); run with command PS C:\Users\dell\desktop\node-tut> node .\express.js run in web http://localhost:5000/about v ar http = require ( 'http' ),     fs = require ( 'fs' ); fs . readFile ( './index.html' , function ( err , html ) {     if ( err ) {         throw err ;     }           http . createServer ( function ( request , response ) {           response . writeHeader ( 200 , { "Content-Type" : "text/html" });           response . write ( html );     ...

How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.

  How to upload files and input fields in php with using ajax. How to upload files and input fields in php with using ajax. How to upload files and input fields in php with using ajax. June 05, 2022 How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload files and input fields in php with using ajax.How to upload fil...

How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php

How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filter in php How to add date filte...