form data inserting in MYSQL using ajax HTML JAVASCRIPT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone so in this video tutorial guys I am going to show you how to send your data from your web browser to the server and insert this data inside my MySQL database so everything is happening using the attacks without the page reloading here is I've already created one example for a demo to show you an easier one form which is contained to field first one is for the name and another is for the contact numbers when I enter any my names like production the laQuan technology rules and when I submit it you can see here it should or inserted and when I want to so this happened everything using our Jack's to reload our page or moving to actually another page to see this value in a database you can see it's get inserted so let me start it to see how to create this form but or you can get any form as you want whatever you like like your registration form your login page your comment form or any any form of as you think as it thinks of his head so here is one in gone fans are that is in the third page speed instead of that I created one division which has the idea which are the class attributed class is formed and instead of that the one input type that is text which has the ID attribute is name I can target for it's using its ID attribute in JavaScript another one it takes for the contact which has the idea to British contact so I can target for this tick text field using its ID attribute which is the count and one button and one response element to give to give or to show the response from the server side we and we charge idea attributed response and the button has the on click event when I click on the button it's it's really fire up the function that you send data which is now a greater dictating here in JavaScript so we get started Kaitlyn script tag we close the script tag and create one function the function name is same data instead of that get one variable that is name is equal to document dot get in Leland get element my idea that his name not value so this documents my method is return the value okay document dot get element by ID itself which will be written the value whatever the come inside this input type text' ID is equal to name so I can return this value using this methods it another one is contact is able to document dot get element by IG that is contact not smell results minute and the contact in JavaScript now create one variable that is HTTP request is equal to so now here is already one object HTTP request which is for the attacks now Jax has the one method that is HTTP request to open the connection to be serve all that is sort of that pass one parameter that is both that's the post for I posting the data to the server side and here is the file name so now in my project by creating the new file and saving this file in my pushing directly create a new project that is a Jack's file and I thought on that gave data dot PHP file I said I'm gonna get doctor to file name save it and pass this failure so here my actual file is located so you can see a dot C F that is a direct name is lastly yes / the finalists need that case with as if synchronous is true so this is another one method to say that the request header so it need to pass two parameters that is this content type application xwd formula encoded now the I and which are the function recall [Music] so now get one if determined to check the your requested or not sin so instead of Dan check this irrigation drone arson HTP request the four means you are on the server giving the response and status is visible who is equal to 200 is that mint okay so now our targeting for this area and span ID is equal to response to take the response from the server side gave women behind this that this innerhtml is equal to HTTP request/response text now it's time to send the data to the server [Music] so it's all of that so cypriot its parameter that is key were the value with a and percent so it should be saying the value in the form of array in the post method to read server-side so getting gained at a place to file to check your data is coming or not if it's 8 forced me to contend names so if block will be executives otherwise not so create two variable that is name which is written the name coming from the server in client-side and the contact which is written the contact from the server-side sorry from the client-side whatever the continent from the client-side in the post method what poster is right now it's time to connect with the MySQL server to connect - oh great one variable that Corning is a masculine connect plus for inside of that pass first parameter the local load that is my machine address so my database is running on the my own machine - bypassing the local host the community root password is little blind but because the password if I don't set I know I set it for the miles well another one is the tablets now create one useful variable be visible to discuss little mange get engaged admin and info and escrow and insert so copy this SQL statement and a chance idea so remove this all value and type here the names and context because of my name is store inside his name variables and the past concern contacted store inside the contacts so here is radio neoscope determined now execute this with the miles for like ridiculous Parsa the first parameter is connection is another is SQL check its exhibiting or not if the result is equal to 2 2 is equal to true which should be equal down a ch3 and sir Ted [Music] so here is a he said we miss one parent assist [Music] so I thought being named anything fool who whatever anything if I submit as you can see it's censored this to field whatever the data coming inside mask you l see you can see here shielding happen using the jacks hey guys if you're any question about it so comment on you liked it subscribe it subscribe me and if you what if you fertilize watching by Saddam
Info
Channel: Balaji Admane
Views: 46,283
Rating: undefined out of 5
Keywords: AJAX, MYSQL AJAX, HTML, Web Development
Id: OMnA0BQfPG8
Channel Id: undefined
Length: 9min 36sec (576 seconds)
Published: Mon Sep 25 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.