-- changed the website url to which to post --
<form method="POST" action="http://sites.fastspring.com/YourCompanyOrAccountName/api/order">
<input type="hidden" name="operation" value="create"/>
<input type="hidden" name="destination" value="checkout"/>
<p><input type="hidden" name="product_1_path"
value="/productPathGoesHere">
<input type="text" name="product_1_quantity" value="0"/> 1234-ABCD</p>
<p><input type="submit" value="Order Now"/></p>
</form>
I have tried
if (!function_exists('fopen'))
{echo' not allowd fopen ';}
$params = array('http' => array(
'method' => 'post',
'content' => $data
));
if ($optional_headers !== null) {
$params['http']['header'] = $optional_headers;
}
$ctx = stream_context_create($params);
$fp = fopen($url, 'rb', false, $ctx);
if (!$fp) {
throw new Exception("Problem with $url, $php_errormsg");
}
$response = @stream_get_contents($fp);
if ($response === false) {
throw new Exception("Problem reading data from $url, $php_errormsg");
}
return $response;
}
but does not work and throws exception, am I doing something wrong or there is alternate way to do it or can it be issue with hosting, I am using 1and1.
Any help is appreciated.
--
Anjan Bhowmik
Freelance Software & Web Developer
M : +880 - 1670 - 556419
E : anjan011@gmail.com, info@ultrasoftbd.com
No comments:
Post a Comment