Ahh, you had the same problem as I.  Fortunately, I've worked out a pretty
good fix.  It makes use of the CURL module in PHP.  I think CURL comes
standard in the 4.x versions of PHP,  but I'm not sure.

Anywho, here's the code:

------BEGIN CODE---------
<?php
$ch = curl_init("https://url.authnet.com";);
$data =
"x_Version=3.0&x_Login=loginname&x_adc_url=False&x_adc_delim_data=TRUE&x_car
d_num=1234123412341234&x_exp_date=0104&x_Amount=24.45&x_Test_Request=TRUE&x_
Type=AUTH_CAPTURE&x_first_name=FNAME&x_last_name=LNAME&x_email_merchant=TRUE
";
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
$buf = curl_exec ($ch); //execute post and get results
echo($buf);
curl_close ($ch);
?>
-----END CODE-----

Be sure to include the 'https://' in the curl_init() function.  That is what
tells the program that all the data should be encoded.  Obviously, the
'$data' variable holds all the post data and you can, of course, build this
string on the fly with form data etc.

Pretty simple once you know how to do it.

Best regards,

Jeremy Reed
"David Johansen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Could someone tell me where I could get a basic Authorize.net example to
> work off of. I'm sure that I could do it all from scratch, but a base to
> start from would be nice and make it a lot faster. Thanks,
> Dave
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to