I have the files test.html, test.js and test.php in my directory. I am trying to send some data to my backend, which should be dealt with by test.php. I run my server using PHP’s built-in webserver with the command php -S 0.0.0.0:8080 -t test-server/. Here’s a simplified demonstration, whenever I …
Tag: xmlhttprequest
AJAX with XMLHttpRequest doesn’t send data
I want to build a simple program using XMLHttpRequest to calculate the area of the triangle. I used this code for client-side; This code is for the server side. Even tried so many codes, It doesn’t send the data to server side. Answer I found the mistake. I was sending the parameters as part of the URL,…
XMLHttpRequest not sending token (Laravel page expired)
I’m using Laravel and trying to send a form via XMLHttpRequest. It works but the request in the controller doesn’t identify it as ajax. The form has a csrf input. I’ve tried several things, right now my code looks like: But Laravel keeps sending a 419 | Page Expired response. Maybe I’m…
XMLHttpRequest Send converted to PHP file_get_contents
So I’m trying to get the send data in an XHR to be put into the header in PHP’s file_get_contents. Because I need the exact Referer header when sending the post request, I need to do it PHP file_get_contents with stream_context_create style. I basically need this: turned into PHP, like this: I do …
Multiple xmlhttprequestes not sending data to back-end
I’m new to xmlhttprequests, so please bear with me. I am trying to make a program that records the users key press and send it to server to save it to a .txt file, but it is not working. The problem is from the JavaScript side it is not sending the data to the server side. Is it not allowed
Output PHP already encode to json, and send to javascript to be json, not working
I’m do output with json_encode to sending to javascript, with this code. so output show like this, [{“id”:”121353568″,”name”:”Baju Casual – Black”},{“id”:”556903232″,”name”:”Tas LV – Red”},{“…
Why does my XMLHttpRequest aborts on PHP file upload?
I’m trying to upload a video file via AJAX, a XMLHttpRequest and PHP to display the upload progress but the request throws an abort and quickly refreshes the page if I try to upload something. If I just send the POST request to the PHP file via the form, without AJAX/XMLHttpRequest, the file upload work…
Can an XMLHTTPRequest capture form data, and be sent to a PHP cURL request to be posted?
I have a javascript file that captures form input, makes an XMLHTTP POST request with the input, and handles errors. I am currently POSTing to a separate PHP file, as the request requires sensitive API data and needs encoding. From the PHP file, I then send a cURL request to post the form input to the remote …
Sending password over XML HTTP request post (HTTPS enabled)
Could use some help sorting out best practices with sending passwords in XML requests. I need to collect input from an HTML form, and if the provided password matches what’s on the server, insert the data from the form into a database. I’d like to do this via Javascript/XML requests so I can displ…
Why Did The Strings Fail To Transfer From Javascript To Php? [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed last year. Improve this question Ok, so I am trying to send data to php from javascript and I’ve b…