CoderFunda
  • Home
  • About us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • About us
  • Home
  • Php
  • HTML
  • CSS
  • JavaScript
    • JavaScript
    • Jquery
    • JqueryUI
    • Stock
  • SQL
  • Vue.Js
  • Python
  • Wordpress
  • C++
    • C++
    • C
  • Laravel
    • Laravel
      • Overview
      • Namespaces
      • Middleware
      • Routing
      • Configuration
      • Application Structure
      • Installation
    • Overview
  • DBMS
    • DBMS
      • PL/SQL
      • SQLite
      • MongoDB
      • Cassandra
      • MySQL
      • Oracle
      • CouchDB
      • Neo4j
      • DB2
      • Quiz
    • Overview
  • Entertainment
    • TV Series Update
    • Movie Review
    • Movie Review
  • More
    • Vue. Js
    • Php Question
    • Php Interview Question
    • Laravel Interview Question
    • SQL Interview Question
    • IAS Interview Question
    • PCS Interview Question
    • Technology
    • Other

08 July, 2019

C++ in Hindi Introduction

 Programing Coderfunda     July 08, 2019     C++-Introduction     No comments   


C ++ का परिचयC ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पहले, c और Simula 67 दो लोकप्रिय भाषाएँ थीं। ब्रेज़ेन स्ट्रॉस्ट्रुप दोनों भाषाओं के साथ मिलकर ऐसी भाषा बनाना चाहता था, जिसमें ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग की सभी विशेषता


C ++ was developed in Bell Labs in 1979. C ++ is a middle level language. Features high level and low level languages All features of C language are found in C ++ There are 3 important features of C ++ object oriented Low level easy to learn Use of C ++ C ++ is used and how you can use it, let's try it out. C ++ is the most commonly used software. Such as C ++ is used to create a device driver. This is a multipurpose language You can use it to crack big software Today C ++ is mostly used for education purposes. Because the features of all major languages ​​have been taken from C ++ If you understand C ++ then you can easily understand other languages ​​as well. The extension of the C ++ c language Therefore, all those software that can be created in C ++ too. If you want to work on the lower level as well as the highest level then you are using C ++ Mostly, as is new programming language, it does not openly support the pointer. If you want to create software using the indicator, you can use C ++ Object-oriented principle Further information about object-oriented theory to be supported by C ++ is explained further. class Class is a user-defined data type This is similar to the structure in the same language. But in sections you can do changes related to changes as well as those related to them. A class provides a data-centric approach to programmers. By the class you can separate the variable and related tasks. More about this you learn from the C ++ - class and object tutorials. The objects As you know, Class is a user-defined data type The class By object you can access the squares and functions of the square. Abstraction Abstraction means that the end user should be the same functional show, which needs to be hased, hidden background functionality For example, when you drive a car, you only focus on clutch, gear and steering, you have no sense in how the engine is working. encapsulation In other words Encapsulation Encapsulation is a one-object oriented programming feature that binds data members (variables) and related tasks such as in the class. Also, encapsulation is protected from access to outside data and functions. Encapsulation property provides protection for level 3 (public, private, protected) Encapsulation is implemented through the classes Inheritance Inheritance Object Oriented Programming Concept In which one code can be used elsewhere This principle code re-usable implementation For example, you can do the work that has been created in a class in the second category, so that you do not need to re-write these tasks. And you will be able to access them from both classes. Polymorphism Polymorphism means a name has many functions. In it you have to implement many types of tasks with one name. Polymorphous work in C ++ is implemented by overloading in which the functions of a name are executed in different situations Messaging In object-oriented programming, objects interact with each other, from which shows the real-life situation. A sample C ++ program # <iostream> INT main () { cout << "Hello Reader"; Return 0; } This example is being specified below. The header file is included in the first row. You need this header file After the start of the program Simple message has printed through the cout function Work is refunded by return statement The program given below was produced and produced. Hello reader In this tutorial, you have learned about C ++ history, applications and different features. Data is important in any program Only all operations are performed on data Before you start programming in C ++, you need to know about various data types of C ++
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

C++ in Hindi Introduction

 Programing Coderfunda     July 08, 2019     C++-Introduction     No comments   


C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पहले, c और Simula 67 दो लोकप्रिय भाषाएँ थीं। ब्रेज़ेन स्ट्रॉस्ट्रुप दोनों भाषाओं के साथ मिलकर ऐसी भाषा बनाना चाहता था, जिसमें ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग की सभी विशेषता


C ++ was developed in Bell Labs in 1979. C ++ is a middle level language. Features high level and low level languages All features of C language are found in C ++ There are 3 important features of C ++ object oriented Low level easy to learn Use of C ++ C ++ is used and how you can use it, let's try it out. C ++ is the most commonly used software. Such as C ++ is used to create a device driver. This is a multipurpose language You can use it to crack big software Today C ++ is mostly used for education purposes. Because the features of all major languages ​​have been taken from C ++ If you understand C ++ then you can easily understand other languages ​​as well. The extension of the C ++ c language Therefore, all those software that can be created in C ++ too. If you want to work on the lower level as well as the highest level then you are using C ++ Mostly, as is new programming language, it does not openly support the pointer. If you want to create software using the indicator, you can use C ++ Object-oriented principle Further information about object-oriented theory to be supported by C ++ is explained further. class Class is a user-defined data type This is similar to the structure in the same language. But in sections you can do changes related to changes as well as those related to them. A class provides a data-centric approach to programmers. By the class you can separate the variable and related tasks. More about this you learn from the C ++ - class and object tutorials. The objects As you know, Class is a user-defined data type The class By object you can access the squares and functions of the square. Abstraction Abstraction means that the end user should be the same functional show, which needs to be hased, hidden background functionality For example, when you drive a car, you only focus on clutch, gear and steering, you have no sense in how the engine is working. encapsulation In other words Encapsulation Encapsulation is a one-object oriented programming feature that binds data members (variables) and related tasks such as in the class. Also, encapsulation is protected from access to outside data and functions. Encapsulation property provides protection for level 3 (public, private, protected) Encapsulation is implemented through the classes Inheritance Inheritance Object Oriented Programming Concept In which one code can be used elsewhere This principle code re-usable implementation For example, you can do the work that has been created in a class in the second category, so that you do not need to re-write these tasks. And you will be able to access them from both classes. Polymorphism Polymorphism means a name has many functions. In it you have to implement many types of tasks with one name. Polymorphous work in C ++ is implemented by overloading in which the functions of a name are executed in different situations Messaging In object-oriented programming, objects interact with each other, from which shows the real-life situation. A sample C ++ program # <iostream> INT main () { cout << "Hello Reader"; Return 0; } This example is being specified below. The header file is included in the first row. You need this header file After the start of the program Simple message has printed through the cout function Work is refunded by return statement The program given below was produced and produced. Hello reader In this tutorial, you have learned about C ++ history, applications and different features. Data is important in any program Only all operations are performed on data Before you start programming in C ++, you need to know about various data types of C ++
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Introduction to HTML Tags

 Programing Coderfunda     July 08, 2019     HTML-Tag     No comments   

Introduction to HTML Tags

An HTML file is a combination of tags and text. HTML tags are also called HTML elements. If you understand the concept of tags, you can easily understand HTML. Because HTML works entirely through tags.

When HTML was designed in the beginning, it was used only to display text in webpages. HTML was very limited at that time and there were only few tags in it. The process of displaying text in webpages by HTML tags was called marking the text. This is why HTML was called text markup language.



At that time, HTML was used only by computer scientists who published their papers on HTML the world wide web so that other scientists could read them. But the HTML was so simple and effective that it became very popular and many people started using it.

Slowly as soon as the HTML became popular, the need to show different elements in webpages increased. Now HTML is not just a text markup language. Now you can insert various types of elements such as lists, tables images, audio, video, graphics etc. into webpages via HTML.

Elements (lists, tables, images, video, etc.) are inserted in HTML tags only in any webpage. Whatever you want to add to the webpage will be added by tags only. HTML provides you many tags for this. All these tags are familiar with the interpreter.



Interpreter is a program that happens in all web browsers. This program recognizes HTML tags and shows them the meaning of text, images, lists and tables corresponding to the same in the web page.

By Basically tags you tell the interpreter what you want to display in the webpage. For example, if you want to add an image to a webpage, you will define <img> tag in its HTML file.

The purpose of most HTML tags can be understood only by their name. For example, <table> tag is used to insert table in webpage. As you begin to use them, you can easily remember what a particular tag is used for.

Syntax of HTML Tags
Generally there are 3 parts of the HTML tag. Opening tag is initially applied. This lets the interpreter know what you are going to do. After the opening tag, the text is written on which this tag is being applied. After this the closing tag is written.

Interpreters from the closing tag know that this tag used to exist. To separate the closing tag from the opening tag, the forward slash is applied in the closing tag.

The general syntax of HTML tags is being given below.

<tagName> text </ tagName>
Not all HTML tags are cloned by the closing tag. There are also HTML tags that are defined only by the opening tag. Such tags are called empty tags. Their syntax is being given below.

<tagName>
There are also some types of tags in HTML that are defined by both the opening and closing parts of the same part. The name of the first tag is written after which the forward slash is applied. Their syntax is being given below.

<tagName />
Types of HTML Tags
There are many types of tags available in HTML. Some tags are used to format text, then some are used for inserting multimedia elements such as images, audio, video etc.

Some tags of HTML are used to create structures such as tables, sections, and lists, so some tags also work like containers under which other tags are define that are sub tags.



The tags of all types of HTML are divided into some main categories and being told below.

Basic Tags
Basic tags are tags that are essentially used in all HTML documents. These tags define the core structure of an HTML document. The list of basic tags of HTML is given below.

<html> - This tag defines an HTML file. Every HTML file is started with the same tag.
<head> - In this tag, related scripts and styles are defined from the webpage.
<title> - This tag defines the title of the web page.
<body> - The main content of the webpage is defined in this tag.
Formatting Tags
Formatting tags are tags that are used to format text. These tags only apply to text and control the presentation of text. The list of the formatting tags of HTML is given below.

<i> - Text is made to italic by this tag.
<b> - The text is bolded by this tag.
<u> - Text is underline with this tag.
<ins> - This tag defines such text which has been added to the content later.
<mark> - Text is highlighted by this tag.
<sup> - Text from this tag is defined as a superscript.
<sub> - Text from this tag is defined as subscript.
<small> - This tag is defined as a small text.
<del> - Text is deleted from this tag.
<strong> - Text from this tag is shown bold (bold).
Form and Input Tags
Form and input tags in the form of creating forms and user-input
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Introduction to HTML Tags

 Programing Coderfunda     July 08, 2019     HTML-Tag     No comments   

Introduction to HTML Tags

An HTML file is a combination of tags and text. HTML tags are also called HTML elements. If you understand the concept of tags, you can easily understand HTML. Because HTML works entirely through tags.

When HTML was designed in the beginning, it was used only to display text in webpages. HTML was very limited at that time and there were only few tags in it. The process of displaying text in webpages by HTML tags was called marking the text. This is why HTML was called text markup language.



At that time, HTML was used only by computer scientists who published their papers on HTML the world wide web so that other scientists could read them. But the HTML was so simple and effective that it became very popular and many people started using it.

Slowly as soon as the HTML became popular, the need to show different elements in webpages increased. Now HTML is not just a text markup language. Now you can insert various types of elements such as lists, tables images, audio, video, graphics etc. into webpages via HTML.

Elements (lists, tables, images, video, etc.) are inserted in HTML tags only in any webpage. Whatever you want to add to the webpage will be added by tags only. HTML provides you many tags for this. All these tags are familiar with the interpreter.



Interpreter is a program that happens in all web browsers. This program recognizes HTML tags and shows them the meaning of text, images, lists and tables corresponding to the same in the web page.

By Basically tags you tell the interpreter what you want to display in the webpage. For example, if you want to add an image to a webpage, you will define <img> tag in its HTML file.

The purpose of most HTML tags can be understood only by their name. For example, <table> tag is used to insert table in webpage. As you begin to use them, you can easily remember what a particular tag is used for.

Syntax of HTML Tags
Generally there are 3 parts of the HTML tag. Opening tag is initially applied. This lets the interpreter know what you are going to do. After the opening tag, the text is written on which this tag is being applied. After this the closing tag is written.

Interpreters from the closing tag know that this tag used to exist. To separate the closing tag from the opening tag, the forward slash is applied in the closing tag.

The general syntax of HTML tags is being given below.

<tagName> text </ tagName>
Not all HTML tags are cloned by the closing tag. There are also HTML tags that are defined only by the opening tag. Such tags are called empty tags. Their syntax is being given below.

<tagName>
There are also some types of tags in HTML that are defined by both the opening and closing parts of the same part. The name of the first tag is written after which the forward slash is applied. Their syntax is being given below.

<tagName />
Types of HTML Tags
There are many types of tags available in HTML. Some tags are used to format text, then some are used for inserting multimedia elements such as images, audio, video etc.

Some tags of HTML are used to create structures such as tables, sections, and lists, so some tags also work like containers under which other tags are define that are sub tags.



The tags of all types of HTML are divided into some main categories and being told below.

Basic Tags
Basic tags are tags that are essentially used in all HTML documents. These tags define the core structure of an HTML document. The list of basic tags of HTML is given below.

<html> - This tag defines an HTML file. Every HTML file is started with the same tag.
<head> - In this tag, related scripts and styles are defined from the webpage.
<title> - This tag defines the title of the web page.
<body> - The main content of the webpage is defined in this tag.
Formatting Tags
Formatting tags are tags that are used to format text. These tags only apply to text and control the presentation of text. The list of the formatting tags of HTML is given below.

<i> - Text is made to italic by this tag.
<b> - The text is bolded by this tag.
<u> - Text is underline with this tag.
<ins> - This tag defines such text which has been added to the content later.
<mark> - Text is highlighted by this tag.
<sup> - Text from this tag is defined as a superscript.
<sub> - Text from this tag is defined as subscript.
<small> - This tag is defined as a small text.
<del> - Text is deleted from this tag.
<strong> - Text from this tag is shown bold (bold).
Form and Input Tags
Form and input tags in the form of creating forms and user-input
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

HTML Introduction

 Programing Coderfunda     July 08, 2019     HTML-Introduction     No comments   

Introduction to Hypertext Markup Language (HTML)

A way to present HTML information in a beautiful and attractive way in the World Wide Web. HTML was created in 1991 by Tim Berners lee.
Let's first try to understand the meaning of HTML. The full form of HTML is Hyper Text Markup Language. Each of these words has a special meaning that is explained by detail below.
HyperHyper means that the HTML does not work in the sequence. As in any programming language, the next statement execute after a statement is executed. If there is a link in an HTML file and the user clicks on it, then it opens.
It does not matter how many elements are there before and whether they are all loaded or not. All the elements of an HTML file are independent of each other. It is also not necessary that any other HTML file can not be executed before any HTML file. Like all HTML elements, all HTML files are independent from each other.
TextText is the most important in a web page. Text is the information that is used to present web page design. HTML text is used to format and present in web pages.

Markup

Markup means format of layout and style of text. You mark text by tag. The kind of tags that mark the text, the text is displayed in the web page. For example, if you mark a text by <h1> tag, then that text will appear as a large and bold heading in the webpage.

Language

HTML is a language used for web development.
So what is HTML? (A simple definition in plain hindi)
HTML is a Hyper Text Markup Language that is used to create web pages.
By using different tags of HTML you create web pages and add various elements such as images, audio, video, tables, lists, links and text to them. HTML is the first language taught and taught in the field of web designing.


Cascading Style Sheet (CSS) is also used with HTML, which is used to make webpage even better. Apart from this, using JavaScript with HTML, logic is added to web pages and they are made dynamic.
HTML VersionsSo far there have been many versions of HTML in the industry. Some new elements are added in every version of HTML. All the editions of HTML are explained in detail below.
HTML 1.0This was the first version of HTML. At that time very few people knew about this language and HTML was too limited. At that time nothing more could be done by HTML than creating web pages with simple text.
HTML 2.0This version contained all the features of HTML 1.0. Along with this version, the basic website for developing the HTML website was already done.
HTML 3.0Until the arrival of this version the HTML was very popular. This version was stopped due to a compatibility problem with browsers. But later it was introduced with new and advanced tags.
HTML 3.2In this version some new tags have been added after the previous version. This was the time when the W3C declared the HTML standard for website development. The use of HTML was no longer limited and was being used extensively.
HTML 4.01This version was introduced with some new tags as well as the cascading style sheet. At this time HTML had become completely modern language.
HTML 5.0This is the latest version of HTML. In this, some new tags have been provided for multimedia support. You can get more information about HTML 5 from the HTML5 in Hindi tutorial.
XHTMLThis version came after HTML 4.01. It was added to XML with HTML.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

HTML Introduction

 Programing Coderfunda     July 08, 2019     HTML-Introduction     No comments   

Introduction to Hypertext Markup Language (HTML)

A way to present HTML information in a beautiful and attractive way in the World Wide Web. HTML was created in 1991 by Tim Berners lee.
Let's first try to understand the meaning of HTML. The full form of HTML is Hyper Text Markup Language. Each of these words has a special meaning that is explained by detail below.
HyperHyper means that the HTML does not work in the sequence. As in any programming language, the next statement execute after a statement is executed. If there is a link in an HTML file and the user clicks on it, then it opens.
It does not matter how many elements are there before and whether they are all loaded or not. All the elements of an HTML file are independent of each other. It is also not necessary that any other HTML file can not be executed before any HTML file. Like all HTML elements, all HTML files are independent from each other.
TextText is the most important in a web page. Text is the information that is used to present web page design. HTML text is used to format and present in web pages.

Markup

Markup means format of layout and style of text. You mark text by tag. The kind of tags that mark the text, the text is displayed in the web page. For example, if you mark a text by <h1> tag, then that text will appear as a large and bold heading in the webpage.

Language

HTML is a language used for web development.
So what is HTML? (A simple definition in plain hindi)
HTML is a Hyper Text Markup Language that is used to create web pages.
By using different tags of HTML you create web pages and add various elements such as images, audio, video, tables, lists, links and text to them. HTML is the first language taught and taught in the field of web designing.


Cascading Style Sheet (CSS) is also used with HTML, which is used to make webpage even better. Apart from this, using JavaScript with HTML, logic is added to web pages and they are made dynamic.
HTML VersionsSo far there have been many versions of HTML in the industry. Some new elements are added in every version of HTML. All the editions of HTML are explained in detail below.
HTML 1.0This was the first version of HTML. At that time very few people knew about this language and HTML was too limited. At that time nothing more could be done by HTML than creating web pages with simple text.
HTML 2.0This version contained all the features of HTML 1.0. Along with this version, the basic website for developing the HTML website was already done.
HTML 3.0Until the arrival of this version the HTML was very popular. This version was stopped due to a compatibility problem with browsers. But later it was introduced with new and advanced tags.
HTML 3.2In this version some new tags have been added after the previous version. This was the time when the W3C declared the HTML standard for website development. The use of HTML was no longer limited and was being used extensively.
HTML 4.01This version was introduced with some new tags as well as the cascading style sheet. At this time HTML had become completely modern language.
HTML 5.0This is the latest version of HTML. In this, some new tags have been provided for multimedia support. You can get more information about HTML 5 from the HTML5 in Hindi tutorial.
XHTMLThis version came after HTML 4.01. It was added to XML with HTML.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

20 June, 2019

Remove duplicates form CSV - PHP Coding Help

 Programing Coderfunda     June 20, 2019     No comments   

<?php
$filename 
= "file.csv"; $file = fopen($filename, "r"); $read = fread($file, filesize($filename));
$split = array_unique(explode("\n", $read));
fclose($file);
$filename2 = "other.csv";
$file2 = fopen($filename2, "a");

foreach(
$split as $key=>$value) {
    if(
$value != "") {
        
fwrite($file2, $value . "\n");
    }
}
fclose($file2);

echo 
"Update done successfully."; ?> 
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Remove duplicates form CSV - PHP Coding Help

 Programing Coderfunda     June 20, 2019     No comments   

<?php
$filename 
= "file.csv"; $file = fopen($filename, "r"); $read = fread($file, filesize($filename));
$split = array_unique(explode("\n", $read));
fclose($file);
$filename2 = "other.csv";
$file2 = fopen($filename2, "a");

foreach(
$split as $key=>$value) {
    if(
$value != "") {
        
fwrite($file2, $value . "\n");
    }
}
fclose($file2);

echo 
"Update done successfully."; ?> 
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

18 June, 2019

Jquery Checkbox check all

 Programing Coderfunda     June 18, 2019     Checkbox, Jquery     No comments   

<input type="checkbox" id="checkAll" > Check All
    <hr />
    <input type="checkbox" id="checkItem"> Item 1
    <input type="checkbox" id="checkItem"> Item 2
    <input type="checkbox" id="checkItem"> Item3


<script>
$("#checkAll").click(function(){
    $('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Jquery Checkbox check all

 Programing Coderfunda     June 18, 2019     Checkbox, Jquery     No comments   

<input type="checkbox" id="checkAll" > Check All
    <hr />
    <input type="checkbox" id="checkItem"> Item 1
    <input type="checkbox" id="checkItem"> Item 2
    <input type="checkbox" id="checkItem"> Item3


<script>
$("#checkAll").click(function(){
    $('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

17 June, 2019

How to Import and Export CSV Files Using PHP and MySQL

 Programing Coderfunda     June 17, 2019     php     No comments   

<?php
session_start();
error_reporting(0);
include('includes/config.php');
include('includes/sessionout.php');
if(strlen($_SESSION['alogin'])==0)
    {  
header('location:index.php');
}
else{

$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
//$connect = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// $success = 1 ;
// $error = 2;

$msg = "CSV Data Imported into the Database";
 $error = "Problem in Importing CSV Data";
 $errors = "No csv file selected";
if (isset($_POST["import"])) {
   

    $fileName = $_FILES["file"]["tmp_name"];
    if ($_FILES["file"]["size"] > 0) {
       
        $file = fopen($fileName, "r");
       
        while (($column = fgetcsv($file, 10000, ",")) !== FALSE) {
          $sqlInsert = "INSERT into lms_master (custid,FirstName ,EmailId,Gender,Dob,Address,    C_Address,City,state,pincode,Mobile,LastStatus,RegDate,LastCall,Remark,Csv_Date)
                   values ('" . $column[0] . "','" . $column[1] . "','" . $column[2] . "','" . $column[3] . "','" . $column[4] . "','" . $column[5] . "','" . $column[6] . "','" . $column[7] . "','" . $column[8] . "','" . $column[9] . "','" . $column[10] . "','" . $column[11] . "','" . $column[12 ] . "','" . $column[13] . "','" . $column[14] . "','" . $column[15] . "')";
            $result = mysqli_query($conn, $sqlInsert);
           
            if ($result) {
                $type = "success";
                header("Location: upload_data.php?success=1");
            } else {
                $type = "error";
                header("Location: upload_data.php?error=2");
            }
        }
    }else{
        $type = "error";
                $errors = "No csv file selected";
                header("Location: upload_data.php?errors=3");
    }
}

?>

<!DOCTYPE html>
<html lang="en">
    <head>       
        <!-- Title -->
        <title>Admin | Import Data</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <meta charset="UTF-8">
        <meta name="description" content="Responsive Admin Dashboard Template" />
        <meta name="keywords" content="admin,dashboard" />
        <meta name="author" content="Steelcoders" />
        <!-- Styles -->
        <link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
        <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
        <link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
        <link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
        <link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
       
        <style>
            .errorWrap {
            padding: 10px;
            margin: 0 0 20px 0;
            background: #fff;
            border-left: 4px solid #dd3d36;
            -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
            box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
            }
            .succWrap{
                padding: 10px;
                margin: 0 0 20px 0;
                background: #fff;
                border-left: 4px solid #5cb85c;
                -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
                box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
            }
        </style>
    </head>
    <body>
  <?php include('includes/header.php');?>
       <?php include('includes/sidebar.php');?>
            <main class="mn-inner">
                <div class="row">
                    <div class="col s12">
                        <div class="page-title"></div>
                    </div>
                    <div class="col s12 m12 l6">
                        <div class="card">
                            <div class="card-content">
                                <div class="row">
                                    <div class="imp_data">
                                    <span class="card-title"><a href="dashboard.php">Dashboard</a>&nbsp;>&nbsp;Employee&nbsp;|&nbsp;Import&nbsp;Data</span>

                                    </div>
                                    <form class="col s12" name="chngpwd" method="post" enctype="multipart/form-data">
                                          <?php if($_GET['error'] == 2 ){?>
                                                <div class="errorWrap">
                                                 <strong>ERROR</strong> : <?php echo htmlentities($error); ?>
                                                </div><?php }
                                                    else if($_GET['success'] == 1){?><div class="succWrap">
                                                    <strong>SUCCESS</strong> : <?php echo htmlentities($msg); ?>
                                                </div>
                                            <?php }?>

                                            <?php if($_GET['errors'] == 3 ){?>
                                                <div class="errorWrap">
                                                 <strong>ERROR</strong> : <?php echo htmlentities($errors); ?>
                                                </div><?php }
                                                    else if($_GET['success'] == 4){?><div class="succWrap">
                                                    <strong>SUCCESS</strong> : <?php echo htmlentities($msg); ?>
                                                </div>
                                            <?php }?>
                                           
                                           
                                        <div class="row">
                                            <div class="input-row">
                                                    <label class="col-md-4 control-label"></label> <input
                                                        type="file" name="file" id="file" accept=".csv">
                                                    <button type="submit" id="submit" name="import"
                                                        class="btn-submit">Import</button>
                                                    <br/>
                                                     <div id="labelError"></div>
                                                </div>
                                                <div id="labelError"></div>
                                            </div>   
                                        </div>
                                    </form>
                                </div>
                            </div>
                         <section>
                                <?php
                                        $sqlSelect = "SELECT * FROM lms_master";
                                        $result = mysqli_query($conn, $sqlSelect);
                                                   
                                        if (mysqli_num_rows($result) > 0) {
                                        ?>
                                        <table id='userTable'>
                                            <thead>
                                                <tr>
                                                    <th>First Name</th>
                                                    <th>EmailId</th>
                                                    <th>Gender</th>
                                                    <th>Dob</th>
                                                    <th>Address</th>
                                                    <th>C_Address</th>
                                                    <th>City</th>
                                                    <th>state</th>
                                                    <th>pincode</th>
                                                    <th>Mobile</th>
                                                    <th>LastStatus</th>
                                                    <th>LastCall</th>
                                                    <th>Remark</th>
                                                    <th>CSV Date</th>
                                                </tr>
                                            </thead>
                                            <?php
                                            while ($row = mysqli_fetch_array($result)) {
                                            ?>
                                            <tbody>
                                                <tr>
                                                    <td><?php  echo $row['FirstName ']; ?></td>
                                                    <td><?php  echo $row['EmailId ']; ?></td>
                                                    <td><?php echo $row['Gender']; ?></td>
                                                    <td><?php  echo $row['Dob']; ?></td>
                                                    <td><?php  echo $row['Address']; ?></td>
                                                    <td><?php  echo $row['C_Address']; ?></td>
                                                    <td><?php  echo $row['City']; ?></td>
                                                    <td><?php  echo $row['state']; ?></td>
                                                    <td><?php  echo $row['pincode']; ?></td>
                                                    <td><?php  echo $row['Mobile']; ?></td>
                                                    <td><?php  echo $row['LastStatus']; ?>
                                                    </td>        
                                                    <td><?php  echo $row['LastCall']; ?></td>
                                                    <td><?php  echo $row['Remark']; ?></td>
                                                    <td><?php  echo $row['Csv_Date']; ?></td>
                                                </tr>
                                             <?php
                                             }
                                             ?>
                                            </tbody>
                                        </table>
                                        <?php } ?>
                            </section> 
                        </div>
                    </div>
                    <!-- start second part right -->
                    <section>
                    </section>
                </div>
            </main>
        </div>
        <div class="left-sidebar-hover"></div>
        <!-- Javascripts -->
        <script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
        <script src="../assets/plugins/materialize/js/materialize.min.js"></script>
        <script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
        <script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
        <script src="../assets/js/alpha.min.js"></script>
        <script src="../assets/js/pages/form_elements.js"></script>
        <!-- Import CSV File -->
        <script type="text/javascript">
            <script type="text/javascript">
        $(document).ready(
            function() {
            $("#frmCSVImport").on(
            "submit",
            function() {
            $("#response").attr("class", "");
            $("#response").html("");
            var fileType = ".csv";
            var regex = new RegExp("([a-zA-Z0-9\s_\\.\-:])+("
                    + fileType + ")$");
            if (!regex.test($("#file").val().toLowerCase())) {
                $("#response").addClass("error");
                $("#response").addClass("display-block");
                $("#response").html(
                        "Invalid File. Upload : <b>" + fileType
                                + "</b> Files.");
                return false;
            }
            return true;
        });
    });
</script>
        </script>
    </body>
</html>
<?php } ?>


<!-- start csv file
 -->
 <?php 
$connect = mysqli_connect("localhost", "root", "", "testing");
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($connect, $data[0]); 
                $item2 = mysqli_real_escape_string($connect, $data[1]);
                $query = "INSERT into excel(excel_name, excel_email) values('$item1','$item2')";
                mysqli_query($connect, $query);
   }
   fclose($handle);
   echo "<script>alert('Import done');</script>";
  }
 }
}
?> 
<!DOCTYPE html> 
<html> 
 <head> 
  <title>Webslesson Tutorial</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> 
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
 </head> 
 <body> 
  <h3 align="center">How to Import Data from CSV File to Mysql using PHP</h3><br />
  <form method="post" enctype="multipart/form-data">
   <div align="center"> 
    <label>Select CSV File:</label>
    <input type="file" name="file" />
    <br />
    <input type="submit" name="submit" value="Import" class="btn btn-info" />
   </div>
  </form>
 </body> 
</html>

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to Import and Export CSV Files Using PHP and MySQL

 Programing Coderfunda     June 17, 2019     php     No comments   

<?php
session_start();
error_reporting(0);
include('includes/config.php');
include('includes/sessionout.php');
if(strlen($_SESSION['alogin'])==0)
    {  
header('location:index.php');
}
else{

$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
//$connect = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// $success = 1 ;
// $error = 2;

$msg = "CSV Data Imported into the Database";
 $error = "Problem in Importing CSV Data";
 $errors = "No csv file selected";
if (isset($_POST["import"])) {
   

    $fileName = $_FILES["file"]["tmp_name"];
    if ($_FILES["file"]["size"] > 0) {
       
        $file = fopen($fileName, "r");
       
        while (($column = fgetcsv($file, 10000, ",")) !== FALSE) {
          $sqlInsert = "INSERT into lms_master (custid,FirstName ,EmailId,Gender,Dob,Address,    C_Address,City,state,pincode,Mobile,LastStatus,RegDate,LastCall,Remark,Csv_Date)
                   values ('" . $column[0] . "','" . $column[1] . "','" . $column[2] . "','" . $column[3] . "','" . $column[4] . "','" . $column[5] . "','" . $column[6] . "','" . $column[7] . "','" . $column[8] . "','" . $column[9] . "','" . $column[10] . "','" . $column[11] . "','" . $column[12 ] . "','" . $column[13] . "','" . $column[14] . "','" . $column[15] . "')";
            $result = mysqli_query($conn, $sqlInsert);
           
            if ($result) {
                $type = "success";
                header("Location: upload_data.php?success=1");
            } else {
                $type = "error";
                header("Location: upload_data.php?error=2");
            }
        }
    }else{
        $type = "error";
                $errors = "No csv file selected";
                header("Location: upload_data.php?errors=3");
    }
}

?>

<!DOCTYPE html>
<html lang="en">
    <head>       
        <!-- Title -->
        <title>Admin | Import Data</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <meta charset="UTF-8">
        <meta name="description" content="Responsive Admin Dashboard Template" />
        <meta name="keywords" content="admin,dashboard" />
        <meta name="author" content="Steelcoders" />
        <!-- Styles -->
        <link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
        <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
        <link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
        <link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
        <link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
       
        <style>
            .errorWrap {
            padding: 10px;
            margin: 0 0 20px 0;
            background: #fff;
            border-left: 4px solid #dd3d36;
            -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
            box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
            }
            .succWrap{
                padding: 10px;
                margin: 0 0 20px 0;
                background: #fff;
                border-left: 4px solid #5cb85c;
                -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
                box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
            }
        </style>
    </head>
    <body>
  <?php include('includes/header.php');?>
       <?php include('includes/sidebar.php');?>
            <main class="mn-inner">
                <div class="row">
                    <div class="col s12">
                        <div class="page-title"></div>
                    </div>
                    <div class="col s12 m12 l6">
                        <div class="card">
                            <div class="card-content">
                                <div class="row">
                                    <div class="imp_data">
                                    <span class="card-title"><a href="dashboard.php">Dashboard</a>&nbsp;>&nbsp;Employee&nbsp;|&nbsp;Import&nbsp;Data</span>

                                    </div>
                                    <form class="col s12" name="chngpwd" method="post" enctype="multipart/form-data">
                                          <?php if($_GET['error'] == 2 ){?>
                                                <div class="errorWrap">
                                                 <strong>ERROR</strong> : <?php echo htmlentities($error); ?>
                                                </div><?php }
                                                    else if($_GET['success'] == 1){?><div class="succWrap">
                                                    <strong>SUCCESS</strong> : <?php echo htmlentities($msg); ?>
                                                </div>
                                            <?php }?>

                                            <?php if($_GET['errors'] == 3 ){?>
                                                <div class="errorWrap">
                                                 <strong>ERROR</strong> : <?php echo htmlentities($errors); ?>
                                                </div><?php }
                                                    else if($_GET['success'] == 4){?><div class="succWrap">
                                                    <strong>SUCCESS</strong> : <?php echo htmlentities($msg); ?>
                                                </div>
                                            <?php }?>
                                           
                                           
                                        <div class="row">
                                            <div class="input-row">
                                                    <label class="col-md-4 control-label"></label> <input
                                                        type="file" name="file" id="file" accept=".csv">
                                                    <button type="submit" id="submit" name="import"
                                                        class="btn-submit">Import</button>
                                                    <br/>
                                                     <div id="labelError"></div>
                                                </div>
                                                <div id="labelError"></div>
                                            </div>   
                                        </div>
                                    </form>
                                </div>
                            </div>
                         <section>
                                <?php
                                        $sqlSelect = "SELECT * FROM lms_master";
                                        $result = mysqli_query($conn, $sqlSelect);
                                                   
                                        if (mysqli_num_rows($result) > 0) {
                                        ?>
                                        <table id='userTable'>
                                            <thead>
                                                <tr>
                                                    <th>First Name</th>
                                                    <th>EmailId</th>
                                                    <th>Gender</th>
                                                    <th>Dob</th>
                                                    <th>Address</th>
                                                    <th>C_Address</th>
                                                    <th>City</th>
                                                    <th>state</th>
                                                    <th>pincode</th>
                                                    <th>Mobile</th>
                                                    <th>LastStatus</th>
                                                    <th>LastCall</th>
                                                    <th>Remark</th>
                                                    <th>CSV Date</th>
                                                </tr>
                                            </thead>
                                            <?php
                                            while ($row = mysqli_fetch_array($result)) {
                                            ?>
                                            <tbody>
                                                <tr>
                                                    <td><?php  echo $row['FirstName ']; ?></td>
                                                    <td><?php  echo $row['EmailId ']; ?></td>
                                                    <td><?php echo $row['Gender']; ?></td>
                                                    <td><?php  echo $row['Dob']; ?></td>
                                                    <td><?php  echo $row['Address']; ?></td>
                                                    <td><?php  echo $row['C_Address']; ?></td>
                                                    <td><?php  echo $row['City']; ?></td>
                                                    <td><?php  echo $row['state']; ?></td>
                                                    <td><?php  echo $row['pincode']; ?></td>
                                                    <td><?php  echo $row['Mobile']; ?></td>
                                                    <td><?php  echo $row['LastStatus']; ?>
                                                    </td>        
                                                    <td><?php  echo $row['LastCall']; ?></td>
                                                    <td><?php  echo $row['Remark']; ?></td>
                                                    <td><?php  echo $row['Csv_Date']; ?></td>
                                                </tr>
                                             <?php
                                             }
                                             ?>
                                            </tbody>
                                        </table>
                                        <?php } ?>
                            </section> 
                        </div>
                    </div>
                    <!-- start second part right -->
                    <section>
                    </section>
                </div>
            </main>
        </div>
        <div class="left-sidebar-hover"></div>
        <!-- Javascripts -->
        <script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
        <script src="../assets/plugins/materialize/js/materialize.min.js"></script>
        <script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
        <script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
        <script src="../assets/js/alpha.min.js"></script>
        <script src="../assets/js/pages/form_elements.js"></script>
        <!-- Import CSV File -->
        <script type="text/javascript">
            <script type="text/javascript">
        $(document).ready(
            function() {
            $("#frmCSVImport").on(
            "submit",
            function() {
            $("#response").attr("class", "");
            $("#response").html("");
            var fileType = ".csv";
            var regex = new RegExp("([a-zA-Z0-9\s_\\.\-:])+("
                    + fileType + ")$");
            if (!regex.test($("#file").val().toLowerCase())) {
                $("#response").addClass("error");
                $("#response").addClass("display-block");
                $("#response").html(
                        "Invalid File. Upload : <b>" + fileType
                                + "</b> Files.");
                return false;
            }
            return true;
        });
    });
</script>
        </script>
    </body>
</html>
<?php } ?>


<!-- start csv file
 -->
 <?php 
$connect = mysqli_connect("localhost", "root", "", "testing");
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($connect, $data[0]); 
                $item2 = mysqli_real_escape_string($connect, $data[1]);
                $query = "INSERT into excel(excel_name, excel_email) values('$item1','$item2')";
                mysqli_query($connect, $query);
   }
   fclose($handle);
   echo "<script>alert('Import done');</script>";
  }
 }
}
?> 
<!DOCTYPE html> 
<html> 
 <head> 
  <title>Webslesson Tutorial</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> 
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
 </head> 
 <body> 
  <h3 align="center">How to Import Data from CSV File to Mysql using PHP</h3><br />
  <form method="post" enctype="multipart/form-data">
   <div align="center"> 
    <label>Select CSV File:</label>
    <input type="file" name="file" />
    <br />
    <input type="submit" name="submit" value="Import" class="btn btn-info" />
   </div>
  </form>
 </body> 
</html>

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • Write API Integrations in Laravel and PHP Projects with Saloon
    Write API Integrations in Laravel and PHP Projects with Saloon Saloon  is a Laravel/PHP package that allows you to write your API integratio...
  • Credit card validation in laravel
      Validation rules for credit card using laravel-validation-rules/credit-card package in laravel Install package laravel-validation-rules/cr...
  • iOS 17 Force Screen Rotation not working on iPAD only
    I have followed all the links on Google and StackOverFlow, unfortunately, I could not find any reliable solution Specifically for iPad devic...
  • C++ in Hindi Introduction
    C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पह...
  • Python AttributeError: 'str' has no attribute glob
    I am trying to look for a folder in a directory but I am getting the error.AttributeError: 'str' has no attribute glob Here's ...

Categories

  • Ajax (26)
  • Bootstrap (30)
  • DBMS (42)
  • HTML (12)
  • HTML5 (45)
  • JavaScript (10)
  • Jquery (34)
  • Jquery UI (2)
  • JqueryUI (32)
  • Laravel (1017)
  • Laravel Tutorials (23)
  • Laravel-Question (6)
  • Magento (9)
  • Magento 2 (95)
  • MariaDB (1)
  • MySql Tutorial (2)
  • PHP-Interview-Questions (3)
  • Php Question (13)
  • Python (36)
  • RDBMS (13)
  • SQL Tutorial (79)
  • Vue.js Tutorial (68)
  • Wordpress (150)
  • Wordpress Theme (3)
  • codeigniter (108)
  • oops (4)
  • php (853)

Social Media Links

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • July (2)
  • September (100)
  • August (50)
  • July (56)
  • June (46)
  • May (59)
  • April (50)
  • March (60)
  • February (42)
  • January (53)
  • December (58)
  • November (61)
  • October (39)
  • September (36)
  • August (36)
  • July (34)
  • June (34)
  • May (36)
  • April (29)
  • March (82)
  • February (1)
  • January (8)
  • December (14)
  • November (41)
  • October (13)
  • September (5)
  • August (48)
  • July (9)
  • June (6)
  • May (119)
  • April (259)
  • March (122)
  • February (368)
  • January (33)
  • October (2)
  • July (11)
  • June (29)
  • May (25)
  • April (168)
  • March (93)
  • February (60)
  • January (28)
  • December (195)
  • November (24)
  • October (40)
  • September (55)
  • August (6)
  • July (48)
  • May (2)
  • January (2)
  • July (6)
  • June (6)
  • February (17)
  • January (69)
  • December (122)
  • November (56)
  • October (92)
  • September (76)
  • August (6)

Loading...

Laravel News

Loading...

Copyright © CoderFunda | Powered by Blogger
Design by Coderfunda | Blogger Theme by Coderfunda | Distributed By Coderfunda