pwntastic Posted July 6, 2013 Share Posted July 6, 2013 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. Link to comment https://forums.phpfreaks.com/topic/279911-sending-data-to-php-file-on-another-server-with-js/ Share on other sites More sharing options...
kicken Posted July 6, 2013 Share Posted July 6, 2013 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. Link to comment https://forums.phpfreaks.com/topic/279911-sending-data-to-php-file-on-another-server-with-js/#findComment-1439619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.