Ajax Tutorial Post to PHP File XMLHttpRequest Object Return Data JavaScript

  Рет қаралды 199,297

Adam Khoury

Adam Khoury

Күн бұрын

Пікірлер: 207
@megan166
@megan166 7 жыл бұрын
Thank you so much for your tutorials! Too often I feel like I'm being discouraged from learning how to code. Your tutorials are a life saver. Thanks for being a great teacher.
@LukeWatts85
@LukeWatts85 8 жыл бұрын
Thank you! I was getting very frustrated with searching for "How to do... AJAX thing in Javascript" and getting "In jQuery you..." NO! I want to do it in Javascript first! And even worse when people make videos "Javascript AJAX" and then the first thing they do is say "You download jQuery...". I've been facepalming so often over the past hour it's getting rather painful. Anyways, thank you. This is exactly what I was looking for!
@Luggruff
@Luggruff 5 жыл бұрын
3 years too late I bet, but for anyone else reading this, just include the word "vanilla" in your search and if you still get jQuery results, force it away completely by adding "-jquery" (without the quotes) in the search - and then you may even get better results dropping "vanilla" - because if the page with the answer doesn't include the word "jQuery" then there often wasn't any need for anyone on that page to need to specify that it was Vanilla Javascript to begin with.
@comichantv7279
@comichantv7279 3 жыл бұрын
I've watched almost 50 vids about ajax and php but your video made it simple for me to finally understand it, each line of code and how they worked. Thanks for this video.
@kmdchennai
@kmdchennai 7 жыл бұрын
I am a layman n for Ajax n Javascript n php, after watching ur videos any layman can easily understand, I want to try ur codings given in ur video,
@markmessa5888
@markmessa5888 9 жыл бұрын
Exactly what I was looking for! No 3rd party library, just JavaScript! Thnks!
@PeMaCN
@PeMaCN 8 жыл бұрын
Thanks Adam. I've been looking for this for almost two days and this is the first time that someone explains it all and that it's actually working. Thanks one more time.
@thiervoip
@thiervoip 9 жыл бұрын
this video stopped a very long period struggling ...... GREAT THANK YOU!!!!!!!!!!
@RorkeNoel
@RorkeNoel 7 жыл бұрын
Been searching for days for info on how to get return data. Thank you for this tutorial. Excellen!
@mukeshroy4971
@mukeshroy4971 6 жыл бұрын
This is what I need actually, everybody use jquery. Thank you very much
@Dexter101x
@Dexter101x 10 ай бұрын
Damn, this still works even today, thanks Adam
@johnsuyang1504
@johnsuyang1504 6 жыл бұрын
Just Wow. Learning a lot from you Mr.Adam Khoury . Thumbs up.
@Luggruff
@Luggruff 5 жыл бұрын
Great video. Finally helped me grasp how to skip the whole necessity of redirecting to get $_POST values. I had to both rub my eyes when-, and laugh a little about, you using a Dreamweaver function to create a button that took you longer than just writing the code for it directly.
@kcsaswin
@kcsaswin 12 жыл бұрын
I love this video. Thank you so much for sharing. I was looking up material from other websites until i almost gave up! This tutorial saved me and my project! Thank you so much!!!
@GlassesAndCoffeeMugs
@GlassesAndCoffeeMugs 12 жыл бұрын
Very well done! Your accent makes the entire thing more enjoyable. Thank you!
@pablotavarez9401
@pablotavarez9401 8 жыл бұрын
Thank you sooo much. I did a lot of reading but it was only when I found this vid that I began to see the light thanks al lot Adam!!
@Yongsan12
@Yongsan12 5 жыл бұрын
Maybe the only video talking about pure Javasscript AJAX implementation. Thanks!
@Yuzukhane
@Yuzukhane 7 жыл бұрын
never seen a better & clearer tutorial. thank yıou!
@VisionQuest7
@VisionQuest7 13 жыл бұрын
Great job Adam. Your tutorials are always to useful and easy to follow.
@funixer
@funixer 3 жыл бұрын
thanks for this tutorial. I solved my 4 days code problem.
@niccoloraspa2075
@niccoloraspa2075 11 жыл бұрын
thanks man you saved me after hours of trying to figure out ajax
@ravishankar5may
@ravishankar5may 9 жыл бұрын
i dont know everybody , but this is what exactly i want , bro its working grate thank you for the script
@andrewdavis6917
@andrewdavis6917 10 жыл бұрын
Very Nicely done. I appreciate the code review and the commentary on how the different parts of the demo work together.
@Adam.Brookes
@Adam.Brookes 3 жыл бұрын
Literally just saved me hours. Thank you so much!!!
@pokemontoxicrpg
@pokemontoxicrpg 11 жыл бұрын
I can't thank you enough for this script. Im hoping to use other field other than text boxes. Thanks again.
@markifornia
@markifornia 12 жыл бұрын
Great tutorial Adam, very clear. Question though. If my website is using ajax for every page, for simplicity sake - login.php and logout.php. Does that mean I need to create a new request object for every page and assign new variables to pass onto the open and send methods?
@andyd568
@andyd568 10 жыл бұрын
You make it so simple Adam, thank you !
@justlookingaround453
@justlookingaround453 8 жыл бұрын
Thanks, a very helpful video in explaining the basics of Ajax
@slayer0273
@slayer0273 12 жыл бұрын
This is so cool! I understand how Ajax works so much better. Thank you so much for this video tutorial!
@amego2000100
@amego2000100 10 жыл бұрын
thanks mr adms for this winderful course
@jasonwilliams199
@jasonwilliams199 4 жыл бұрын
What additional logic would you have to add to the Ajax in order to post php form data to a MySQL database?
@pradeepmugi
@pradeepmugi 10 жыл бұрын
very useful...i'm searching for exactly the same code adam.....thankuuu
@someshnukala804
@someshnukala804 10 жыл бұрын
Thank you very much sir for giving this valuable tutorial.
@trommelbiel
@trommelbiel 12 жыл бұрын
Programming is fun again. Thanks Adam.
@consumerplus9000
@consumerplus9000 8 жыл бұрын
hello Adam! can you please explain line 11 in detail. what is that equal for infront of the "lastname=" ? I apprecaite if you can explain that line in detial
@glofalcon
@glofalcon 13 жыл бұрын
excellent video. so far the best out there on this topic!!!!
@IPhym
@IPhym 11 жыл бұрын
This is what I'm using, and it's working fine for me, and I'm pretty sure that I have the latest version of Chrome.
@jamesgoodman37
@jamesgoodman37 8 жыл бұрын
Exceedingly helpful, wish I came across it sooner. Thank you.
@rjk1404
@rjk1404 7 жыл бұрын
Excellent work! Nice Voice, clear overview and structured explanation of code. It's a scriptKiddies dream come true! Thanks for sharing your passion ... and time. Guys like you give hope to beginners like me ;o)
@ΓΡΗΓΟΡΑΚΗΣΓΡΗΓΟΡ
@ΓΡΗΓΟΡΑΚΗΣΓΡΗΓΟΡ 11 жыл бұрын
you are best developer....
@JamesRCoston
@JamesRCoston 13 жыл бұрын
Awesome. Will you be doing many more AJAX and PHP tutorials?
@JohnMc10
@JohnMc10 10 жыл бұрын
Thanks again Adam! Very clear and useful...
@mobinshah1
@mobinshah1 10 жыл бұрын
Best tutorial for beginners
@tomzhangus
@tomzhangus 9 жыл бұрын
Awesome. Made something complicated very simple. Thank you sir.
@mynameiskranz
@mynameiskranz 9 жыл бұрын
really?? try using jquery man! $.ajax() this is to complicated.
@gabrielcamilo186
@gabrielcamilo186 9 жыл бұрын
Tom Zhang did not work for me. I'm testing on live sever and still not working
@gabrielcamilo186
@gabrielcamilo186 9 жыл бұрын
Oh, never mind, I was using HTML5 and requires me to use button not submit instead. Is working fine!!
@PeterReginald
@PeterReginald 10 жыл бұрын
I can't wait to apply this to my project. Thanks for the tute!
@tomzhangus
@tomzhangus 9 жыл бұрын
Question: how come you put the "processing..." after sending the data? Wouldn't that always display "processing..."? I tested your code, it works flawlessly, but I'm confused about that part.
@shalinic586
@shalinic586 4 жыл бұрын
Thank you so much!!! This video is very helpful. Could resolve the problem
@sirinetrigui4127
@sirinetrigui4127 8 жыл бұрын
Hi , thx for this tutorial , if i want to use the values of variables on the same page how can I do that? (i want to do $_post[] on the same page without echo )
7 жыл бұрын
how can i call the function from inside a confirmation box i tried doing this and it calls the function without any confirmation coming up?
@herryhariryamin5736
@herryhariryamin5736 6 жыл бұрын
Thank you Adam. Your video is great and helpful
@hoodedwarrior8956
@hoodedwarrior8956 6 жыл бұрын
The only thing you didn't explain was when you did that interpolation in vars, you did that so that it can be valid json?
@arjirissoulios4604
@arjirissoulios4604 8 жыл бұрын
Great videos Adam! If you find the time in the future could you make a tutorial on how to do a live mysql search (that narrows down the database as you write in a search field) without jquery. it seems the .response only handles Text or Xml :(
@TheFastPC
@TheFastPC 10 жыл бұрын
Hi, you suggest we can use an external .js file and call it from inside html, but how can you pass the data to that external file and get the results back? Thanks in advance for your answer, your video is excellent, btw !!!
@PurpleReignUWdawgs
@PurpleReignUWdawgs 10 жыл бұрын
Cody is correct. The browser pulls in all those requirements or dependencies (external files) and renders the page as if everything were basically in the same file. Pretty much like how you 'link' to CSS files, the browser just pulls everything into itself before showing you the page (there is a hierarchy or order to it though, so some things show up first before the others).
@koenlaermans1963
@koenlaermans1963 6 жыл бұрын
What would be the best thing to do if u want to send data to a database and do some email and password checks: put those inputs in a form and post the data to a php file OR just do it like you did, having an onclick event and then post it to php inside your javascript?
@platnumnutz276
@platnumnutz276 12 жыл бұрын
Hey Adam, I noticed an issue when trying to run through this tutorial and couldn't quite put my hands on the issue until later. I now know what the problem is but would like to know more about it. When you normally create a form, you use the form tag and use the action and method attributes to tell the browser what to do. With Ajax it seems like the html form tag clashes with ajax. What is the reason behind the clash? I see in your video you did not use a form element. Can you please explain?
@olekristianmller-hansen4220
@olekristianmller-hansen4220 7 жыл бұрын
Greetngs. Do you know how I can use setInterval with AJAX? I am working on a chat application where I intend to use AJAX to get chat history every 500 milliseconds. I Can't seem to get it right. I try to GET a PHP-file where MySQLi SELECTs chat history from a table and write it to the document.
@enriquefischer7100
@enriquefischer7100 7 жыл бұрын
AMAZING!!! Took me so long to find this...
@lucha0075db
@lucha0075db 7 жыл бұрын
Nice tutorial, What if I don't want the previous data to be on the screen??
@artiny16
@artiny16 8 жыл бұрын
this is possible, when I copy this text, and run it on the server and get back from PHP value of calculation with this function...and use it in the hml file ? if yes,then how ? please
@amitviet
@amitviet 8 жыл бұрын
Thanks for your tutorial, can you please explain how to insert header "X-Requested-With: XMLHttpRequest"
@kennethcarlgalve
@kennethcarlgalve 10 жыл бұрын
WTF HAPPENED TO YOUR VOICE IN 3:05-07? LOL
@GiovanniBaer
@GiovanniBaer 9 жыл бұрын
LMAO
@clarkcalina9782
@clarkcalina9782 9 жыл бұрын
Carl Galve hahahahahahaha u made my day bruu
@kennethcarlgalve
@kennethcarlgalve 9 жыл бұрын
Clark Calins HAHAHAHA that was really funny
@LukeWatts85
@LukeWatts85 8 жыл бұрын
+Carl Galve I know right! It was like Rocky Balboa split personality.
@kevinmarmet
@kevinmarmet 6 жыл бұрын
I just laughed so hard lmfao
@PanCakeMixer101
@PanCakeMixer101 8 жыл бұрын
thanks Adam ! , really learned allot from your tutorial :)
@panasonicyouth1985
@panasonicyouth1985 11 жыл бұрын
3:05 Cheers me up everytime :)
@rmz1994
@rmz1994 11 жыл бұрын
thanks alot man, just for the heck of it im going to click on the ad so you get your money :)
@levdt
@levdt 11 жыл бұрын
good no-frills tut - good job!
@Whoisankit
@Whoisankit 11 жыл бұрын
plz help, i need to upload file on example.html page and doing move_upload at my_parse_file.php, and its showing "moved successfully" n i want this status on the example.html page., now what the query is to get the file path from ajax to my php page?
@timelesshov
@timelesshov 9 жыл бұрын
thanks alot adam. works so well. but i'd like to know how to send photo and text variables to a php file using ajax
@aidThompsin
@aidThompsin 8 жыл бұрын
I'm hitting walls. Just get a "processing" staying there. If i inspect on Chrome it says it cant find the php file, but it is there in the same directory. If i go back to having my ExpressJS/Node (web server) in a separate bootup.js file, it doesnt find that either. What am i doing wrong, that it inexplicably cannot find my folders that exist in the same directory?
@Castdeath
@Castdeath 7 жыл бұрын
That's the cross origin policy fault, it expects that they originate from the same server otherwise it won't load it.
@termodox
@termodox 13 жыл бұрын
i've got one question. at line 16 There is a function that checks the readystate, so what if its not 4, will it loop and wait until 4 or just go to line 23 and send "vars" ? oh and another one: why cant you use insted of var return_data =hr.responseText; document.getElementById("status").innerHTML = return_data; just this document.getElementById("status").innerHTML = hr.responseText; Thanks! Cheers
@Billinous
@Billinous 10 жыл бұрын
How do you send (POST) a variable to the server without a return? My GET requests work, but the POST does not send anything to the php server! echo $_POST['variablename'] returns NULL
@frodohanks1986
@frodohanks1986 11 жыл бұрын
I know how to use ajax send "get" method data to php, but can not figure out how to use "post" method. Thank you for this video that let me learn how to use post method. Thanks!
@CameraDulce
@CameraDulce 8 жыл бұрын
Hello Adam Khoury, first of all I want to say thank you for your free courses. I've been learning a lot from you. So, I am trying to send variable to my post_comment.php; I tried the same way, but when it echo out echo "Your comment: "+ $_POST['cmbx']; it only prints the Your comment,, not the value of $_POST,, I was trying with GET but the same result.
@Luggruff
@Luggruff 5 жыл бұрын
Because you didn't run the file in a PHP-enabled enviroment, like a server with PHP enabled, or localhost with PHP running on it (like for example with XAMPP)
@CsabaKissColorado
@CsabaKissColorado 11 жыл бұрын
Excellent tutorial. Thanks
@kmdchennai
@kmdchennai 7 жыл бұрын
Can u help me in installing php in my system n necessary software required to run ur codings
@salehhatefinya7388
@salehhatefinya7388 7 жыл бұрын
It is great. Thank you, Adam.
@trautwein101
@trautwein101 12 жыл бұрын
Great job...keep it up....its good stuff..
@culefaster
@culefaster 8 жыл бұрын
Buen Video! Muchas Gracias!! Nice Video.. Thankyou very much!!! From: México...
@dirtyweasel
@dirtyweasel 11 жыл бұрын
Great tutorials.
@SuperJAIMISH
@SuperJAIMISH 8 жыл бұрын
I am getting an undefined index error. isset() or empty() is not solving it. Any help is appreciated.
@rakeshkumarark
@rakeshkumarark 11 жыл бұрын
Good tutorial on Ajax. Thank u
@rayzur233
@rayzur233 13 жыл бұрын
thanks! this helped me a lot with my project
@albertangel4291
@albertangel4291 11 жыл бұрын
hey, did you ever get it figured out? I ran into the same issue.
@rayhanain6394
@rayhanain6394 10 жыл бұрын
Thank you genius web page man
@ragomez79
@ragomez79 12 жыл бұрын
Thanks, You saved my live. I'm trying this script with radio buttons group, but something is not working. Do you have some idea?
@tommyk8625
@tommyk8625 7 жыл бұрын
hi, how do I need to change the code if I want to give the whole form an ID ... thanks (I tried a lot nothing worked)
@renboy94
@renboy94 9 жыл бұрын
It works fine except the php file only returns Thank you , says the PHP file.
@neerajsharma8073
@neerajsharma8073 6 жыл бұрын
Wow best explanation
@elvisniperx
@elvisniperx 13 жыл бұрын
thank you Adam Khoury
@FullflapTv2013
@FullflapTv2013 12 жыл бұрын
Great tutorial but without using form tags it won't submit on a return key. How do you get it to do that? I really need the form to submit on return. If I add form tags, it just reloads the whole page.
@maxwilson6844
@maxwilson6844 11 жыл бұрын
Is there a playlist for learning Json?
@jjppmm29
@jjppmm29 12 жыл бұрын
I have been trying to load ajax/jquery with ajax/jquery... but when i do thay dont seem to notice the ajax/jquery or there functions.... this is a problem for me because some pages dont have the same ajax/jquery as my pages are dynamic and i am constantly changing what is needed i would like to find a way around this...
@real_anil9688
@real_anil9688 5 жыл бұрын
Thank for your effort but it doesn't work out for me whenever I put this script in my code the button never responds,plzzzz help!!
@maryannlinsey4962
@maryannlinsey4962 10 жыл бұрын
Thank you very much ADAM!!!
@ghostforlife1
@ghostforlife1 12 жыл бұрын
hey can you please explain how to edit fields which are displayed in ? echo $var ? and how to save them in mysql db, I have many fields like name, surname, telephone, email, and so on. Thank you for your help.
@christianlee3426
@christianlee3426 8 жыл бұрын
does anyone know how you would do the ajax using jquery
@LukeWatts85
@LukeWatts85 8 жыл бұрын
+Christian Lee Hahaha...good one!
@RashidOmar
@RashidOmar 12 жыл бұрын
at 3:06 you sound like Arnie, but good tutorial after all.
@MarcoAntonioGrajeda
@MarcoAntonioGrajeda 11 жыл бұрын
gracias por el aporte amigo, ahora podre seguir trabajando. :D
@louislombardi
@louislombardi 8 жыл бұрын
3:04 Sylvester Stallone.
@cayeauriga9674
@cayeauriga9674 8 жыл бұрын
+Louis Lombardi however, it seriously sounds weird lol
@stevetan8029
@stevetan8029 10 жыл бұрын
hello adam where to check the details? if somebody encode all the fields required where to check them? sorry iam new to this course best regards kristina
@stevetan8029
@stevetan8029 10 жыл бұрын
Fantastic
@General_Aladeen
@General_Aladeen 10 жыл бұрын
watch his social networking tutorial especially in part 6.
@mzalt
@mzalt 12 жыл бұрын
You R the KING of PHP :D
@albertangel4291
@albertangel4291 11 жыл бұрын
Thank you for the tutorial! I trued to apply your code and it seems to stop working on processing.... I never get data back from the php file. I usually don't have a problem in processing php on my local machine. Please help.
JSON and AJAX Tutorial: With Real Examples
40:45
LearnWebCode
Рет қаралды 1,8 МЛН
Learn XML HTTP Requests in JavaScript | AJAX Tutorial
10:09
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 102 МЛН
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 26 МЛН
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 15 МЛН
File Upload Progress Bar Meter Tutorial HTML5 Ajax PHP
24:39
Adam Khoury
Рет қаралды 199 М.
Sending JavaScript Http Requests with XMLHttpRequest
18:53
Academind
Рет қаралды 213 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 102 МЛН