Jump to content
Sign in to follow this  
Mita

how to pass data in php using curl

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...