I was looking many days for a video like this (how I can access JSON Data with PHP sent from vanilla Javascript) and finally found it. You never fail to impress bro.
Thanks a really short and direct tutorial for this matter. I would love to know which extensions you use in your vs code too. maybe you can do a small video about it. keep it up !
When I am using. window.location.replace command to replace current page with another one then the json data is not sending to server, can you tell me why is it happening so please....?
Can you explain the url for POST? I'm having a hard time understanding where people get these mock up url links and where I can get one too, or if I can use a .js or .txt file?
if http sends data in bits and pcs (stream/buffer) how does php server parse the body without 'parsing it' .. In node i think you cant simply log the request which will show the body like that. why the difference. thanks.
Question!, I had this set up via a POST Method on the html and on the php I only had to place $_POST; Why it doesn't work on the same way with this method?
Hey @dcode How can I convert the sent data(user input) to an actual json file so that it can be loaded into a table using ajax. You only seemed to convert it to php here.
Are you using a built-in web server as part of your text editor? Either way, I recommend using a server like Apache/NGINX which will support all request methods
Hi Dom, sorry to bother, I've been watching some of your video tutorials now. As an amateur script writer(still learning), when in the real world would I need to use or run this particular video tutorial? Thanks.
Hi, firstly thank you for the explanation. I have a Newb question, I'm getting the following error "405 (Method Not Allowed)" . I got this approach with your other example as well. what am i missing or doing wrong here? thx
@@dcode-software It's not your fault. It's just me that doesn't want to learn everything. I used to learn PHP when I was 15 (now, 29) and I didn't quite like it as it got me a little confused at that time. However, I am more inclined to learn JS and all that "front" languages, that's more for me to be honest. I'm also not closing the doors to PHP, but I prefer to master languages mentioned above to feel more fomfortable :) Anyway, great work!
If you're unfamiliar with AJAX/XMLHttpRequest, check out my video on the topic:
th-cam.com/video/rjmtYkRK1nM/w-d-xo.html
i want to display the name got in responses in my main html page using innerHtml or something else.
So how can i access the string and display it
How do I submit image and text together in one submission/submit as a stream to an API without getting CORS error
It is amazing how one single line of code can change EVERYTHING... Thank you for your short, but meaningful tutorial!
No worries mate 😁
I was looking many days for a video like this (how I can access JSON Data with PHP sent from vanilla Javascript) and finally found it. You never fail to impress bro.
Thank you, very simple, fast and clear
You're my favorite coding TH-camr. Enjoy every video from you mate!:)
Awesome, thank you! Happy to help
Thanks. Very helpful in December 2022. I've subscribed.
i like your video because you're not indian guy, and you are very good, ty bro
Bro you're a hero without a cape, thanks, the best it's 100% javascript, I hate jquery, you save my life
Absolutely no problem. I suggest you take a look at the Fetch API though.
Great video!
thank you , it's so good
god bless you mate. you save my days
No worries mate
you are the BEST !!! Thanks man
Thanks for the tutorial, I get a json syntax error. How can I validate the requestPayload?
thank you! helped me out!
Thanks a really short and direct tutorial for this matter.
I would love to know which extensions you use in your vs code too. maybe you can do a small video about it. keep it up !
Hey thanks! A few people have asked about my extensions, I'll keep it in mind
he is better than stackoverflow, hell
When I am using. window.location.replace command to replace current page with another one then the json data is not sending to server, can you tell me why is it happening so please....?
This helped me so much, thank you! How would you pass two/multiple arrays to the php file using this method?
So how to you apply this for a practical form, like an email subscription form?
Can you explain the url for POST? I'm having a hard time understanding where people get these mock up url links and where I can get one too, or if I can use a .js or .txt file?
Thank you!
No problem
how to avoid HTTP Error 414. The request URL is too long while using AJAX/XMLHttpRequest
great job as always! :)
Cheers mate :)
thanks, God bless you
Thank you comrade!!
No worries mate
thank u for this great video.
if http sends data in bits and pcs (stream/buffer) how does php server parse the body without 'parsing it' .. In node i think you cant simply log the request which will show the body like that. why the difference. thanks.
thank you very much for the tutorial, I like this 😁😁
I love you thank you
Hello there dcode, how can I redirect to the recieve.php page after posting the json object? I'm stuck
I want to implement this is django. But it asks for csrf token. Please help.
Hey, what if the server side was running on Java instead of php and I'd like to send a json file to the server, can I use the same method?
Yep, it will still work. This method is all about the client-side, it doesn't matter which server side tech you're using
Question!, I had this set up via a POST Method on the html and on the php I only had to place $_POST; Why it doesn't work on the same way with this method?
Can you help me please? I need only to POST to a server. And I write localhost:5000 and I get error:bad request. IDK what to do. HELP pls!!!!
thank you
No worries mate
Hey @dcode How can I convert the sent data(user input) to an actual json file so that it can be loaded into a table using ajax. You only seemed to convert it to php here.
Hi, when I follow your steps, I got an error in the line 'xhr.send(jsonString)'. The error shows 405 (Method Not Allowed). What is the problem?
Are you using a built-in web server as part of your text editor? Either way, I recommend using a server like Apache/NGINX which will support all request methods
Hi Dom, sorry to bother, I've been watching some of your video tutorials now. As an amateur script writer(still learning), when in the real world would I need to use or run this particular video tutorial? Thanks.
Hi, firstly thank you for the explanation. I have a Newb question, I'm getting the following error "405 (Method Not Allowed)" . I got this approach with your other example as well. what am i missing or doing wrong here?
thx
That's a "problem" with your server - try a different server or make sure that your "GET" or "POST" is spelt correctly.
anyone know the vs code theme he is using?
I want a help , can you reply
Notations: 2:44
Why use PHP but the description is JavaScript tutorial
This video is about sending JSON data through a JavaScript AJAX request. The server side technology happens to PHP
Great tutorial, but you've got me lost in PHP T_T
Thanks and yeah look PHP is probably the most well known back end language so that's why I went with it :/
@@dcode-software It's not your fault. It's just me that doesn't want to learn everything. I used to learn PHP when I was 15 (now, 29) and I didn't quite like it as it got me a little confused at that time. However, I am more inclined to learn JS and all that "front" languages, that's more for me to be honest. I'm also not closing the doors to PHP, but I prefer to master languages mentioned above to feel more fomfortable :)
Anyway, great work!
Your keyboard disturb a lot!
it's not ajax. dis,
i can't stand the sound of the fucking keyboard
thank you