Skip to content
Advertisement

Tag: reactjs

Why doesn’t the message POST

When sending data, an empty value comes in Yii2, why is that? Data post: id, name. JS PHP } Code 200, post null Answer By default the Yii reads post params from $_POST global variable. But web server only parses request of body send as application/x-www-form-urlencoded or multipart/form-data. If you send data with Content-Type: application/json they are not parsed into

How to integrate React App With Laravel Sanctum on Apache2

I use React App on localhost:3000 For Laravel API I use apache2 from Laradock and site is: site.localhost To authorize users I use Sanctum Problem is I can not get cookies from sanctum/csrf-cookie (i got them in response header but they are not appear in cookies) and then got 419 code when i try to login via API My .env

General questions about php and react.js [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago. Improve this question I’m about to learn react.js but I have a lot of questions, if I’m learning react do I need PHP?

React app not sending files to php server with Ajax

I’m hosting a react app on my apache server. I’m using react-images-upload npm package to receive an image from the user then post it to my php server with Axios. However when I check the php $_FILES array in the response it’s empty. I have tested wether my server can receive files with a little upload form on the php

React can’t get response body from PHP API

I’m trying to send a POST request to my PHP file and get a response. The response is sent with code 200, however, I don’t see what PHP returns. Here is my react code: And here is my PHP code: Logging response on console returns me: I can’t get the “data” out of PHP. Answer

Advertisement