Jump to content

how to pass data in php using curl


Mita

Recommended Posts

hello,I need help in my academic project. I need to transfer some data from one php script on one machine to that on another. I am using curl for that. I can use CURLOPT_POSTFIELDS for that but it does not transfer the control to second script. I want to use CURLOPT_FOLLOWLOCATION but how to use it i dont know. So please help me out with some code.this is what i tried.curl.php

Link to comment
Share on other sites

You did not mentioned what is happening when you run it. if post fields are array the header is being set to multipart/form-data. you need to send header content-type www/form-urlencode to get the results. if you want to send request to $url you dont need to send location header when you use CURLOPT_URL curl it is being set.

I want to use CURLOPT_FOLLOWLOCATION but how to use it i dont know.
httop://php.net/curl_Setopt check the list here. Edited by birbal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...