Use curl.
If not familiar, google it.
--- In phpexperts@yahoogroups.com, "raj_corporatemunim" <raj_corporatemunim@...> wrote:
>
> -- 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.
>
Tuesday, August 2, 2011
[phpXperts] Re: Tturn this post form into PHP code
__._,_.___
Visit phpXperts website at www.phpxperts.net
.
__,_._,___
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment