I have the following situation:
if(isset($_POST['thisvalue'])) {
$username = $_POST['username'];
$passwd = $_POST['passwd'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.domain.com/scripts/curl/index_general.php' );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_REFERER, 'http://www.domain.com.au' );
curl_setopt($ch, CURLOPT_POSTFIELDS, "body goes here" );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
I can the "http://www.domain.com/scripts/curl/index_general.php" to return a value.
I need to know the best way to complete the line: curl_setopt($ch, CURLOPT_POSTFIELDS, "body goes here" );
How should I send the username/passwd. I will have other time when I need to send more data so I assume (and from my reading that an array is best)...
Currently my data is passed from JQUERY/HTML... how should I then convert this data into an array and the CURL it to the destination domain?
thx