dotkpay Posted May 27, 2012 Share Posted May 27, 2012 Hello, Am writing a php program that is supposed to send data (POST or GET) to a remote website and get a reply. Should I use curl or should I just load the remote file with GET variables inside a <div> using jquery? Link to comment https://forums.phpfreaks.com/topic/263214-php-remote-file/ Share on other sites More sharing options...
.josh Posted May 27, 2012 Share Posted May 27, 2012 You can't really load a remote file with GET variables using jquery (javascript) as this is considered cross-site-scripting (XSS), so you will have to make the request and receive the response server-side. Depending on how the remote server/script is setup, you may be able to just use file_get_contents. But if the remote server/script has some kind of barrier (like detecting and rejecting unless it detects browser headers, needs cookies, etc...) then you will have to use [m=curl]cURL[/m] so that you can set headers, make use of cookies, or whatever other hoops you may have to jump through to handshake with the remote server/script. Link to comment https://forums.phpfreaks.com/topic/263214-php-remote-file/#findComment-1348977 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.