Jump to content

Sending data to PHP file on another server with JS


pwntastic

Recommended Posts

Hello, I'm trying to see if it's possible to send data with JavaScript to a PHP file on another server.  I'm working on a project where I'm pretty much limited to html, css, and js because of where the site is being hosted.  I was thinking I could create a PHP file on another server though, and then just pass data with javascript.  The only thing I can think of right now is form action or window.location and some GET method, but I'd like to see if there's a way that this can be done without redirecting the person back and forth.

You could setup your PHP script to allow Cross-origin resource sharing, that would allow you to use AJAX to make request to the script in the background.

 

Other than that, your stuck sending a request then redirecting back when it is complete. Or possibly iframes, depending on what you need.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.