Hello I am trying to use this API with two different ways and I am not getting the same asnwer : With Javascript : The result I get here is : Which is the expected result… With PHP : The result I get here is : Which is not the expected one.. This problem happens in PHP when I try
Tag: fetch
Cannot get my GRAPHQL response into an iterable JSON format
so a bit of background. I am making a GRAPHQL call to shopify’s graphQL api. I am getting data back (yay!) and it is correct (double yay!!), unfortunately I cannot then do very much with the data other than look at it – I cannot iterate through it with regular JSON syntax. My plan is to then have the data
Laravel fetch data by something else than id
So I’m a total newbie in laravel and I don’t know if it can be done but I saw that in the controller I can display data of a specific ‘id’ with this in my api.php: And this in my BookController.php : I’m using Angular for the front and I have a searchbar to search by ‘title’ of a book,
is `file_get_contents(“php://input”)` the only way to get post data from `fetch` and is it safe to use async- and hack-wise?
I’m trying to rewrite my JQuery $.post() code via native fetch() function. And it seems like the only way to do it with PHP server code is using file_get_contents(“php://input”). I do it like it is shown here and here: js code: myscript.php: There are two things which makes me worried: The project has more than one fetch call like this.
Get Count For A Set Of Fetched Field Values – MySQL / PHP
I have some data returned from a MySQL database that outputs the post details for a particular user. I’d like to output a count for the number of images (represented below by the $db_image_filename value). How do I get a count for the number of field values in a column? I thought I could use PHP’s count() function, but this
How to upload a file using the fetch API in Javascript to a Laravel Controller?
I have a FILES variable that looks like this: I am trying to receive these files at my Laravel controller like so: I am posting to this endpoint using the fetch API like so: In my response (network tab) I get: I tried to JSON.Stringify(FILES) and got: Can anyone point me in the right direction to why the file is
fetch send formdata and recieve it from php
Hello srry for bad english, i’m trying to insert some formdata to my sql database with fetch request, the row was added and the id counts +1, but theres no extra data added to the columns “nomtar”,”destar”,etc JS function on submit form: agregar.php FILE: Answer There’s no need to convert your form data to JSON. Fetch understands FormData directly. Change
How to convert an image from input to json, send it in fetch to php and then send it on server via PHPMailer?
I’m not very good in PHP and all server stuff, so I would appreciate any answers and advice. I need to send JSON data and an image in one fetch to php script. Following this question How can I serialize an input File object to JSON?, I made object from image, put it in fetch and tried to send this
fetch formdata response from php server
I understand that fetch() response lets you receive formData from a server. I searched for an example that implements this functionality but I didn’t find a single one. All examples talk about uploading (posting) formData from a client to a server, but not vice versa. This doesn’t explain the .formData() method of the response. So, could you please direct me
Process inputted data for JS Fetch Api request like jQuery does in Ajax request when processData is true
First of all. Code of ajax_handler.php <?php $res = $_POST; $res['response'] = 'Custom'; header('Content-Type: application/json'); echo json_encode($res); I have jQuery Ajax function with Promise …