Re: AquaticPrime Config.php + PayPal Advanced Variables Not Working
Re: AquaticPrime Config.php + PayPal Advanced Variables Not Working
- Subject: Re: AquaticPrime Config.php + PayPal Advanced Variables Not Working
- From: Chunk 1978 <email@hidden>
- Date: Wed, 4 Feb 2009 09:28:11 -0500
$appLicense = $_REQUEST["appLicense"];
did not work either... :/
On Tue, Feb 3, 2009 at 10:28 PM, Chunk 1978 <email@hidden> wrote:
> someone else told me that in order to use custom variables on my
> paypal buttons i needed to set up IPN, and that the variable would
> become apart of the button's URL... but i'm trying to avoid setting up
> IPN simply because it's seems like overkill and complicated for my
> tired mind... so essentially my button's only have address like this
> with a hosted_button_id:
>
> https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=1234567
>
> i see in apart of the aquatic prime script that it uses the user data:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
> // parse the data
> $lines = explode("\n", $res);
> $keyarray = array();
>
> if (strcmp ($lines[0], "FAIL") == 0)
> {
> // Put in a URL here to redirect back on error
> header("Location: $error_url");
> die;
> }
>
> for ($i = 1; $i < count($lines); $i++)
> {
> list($lineKey, $lineValue) = explode("=", $lines[$i]);
> $keyarray[urldecode($lineKey)] = urldecode($lineValue);
> }
>
> $product = $keyarray['item_name'];
> $name = $keyarray['first_name']." ".$keyarray['last_name'];
> $email = $keyarray['payer_email'];
> $amount = $keyarray['mc_gross'];
> $count = $keyarray['quantity'];
> // RFC 2822 formatted date
> $timestamp = date("r", strtotime($keyarray['payment_date']));
> $transactionID = $keyarray['txn_id'];
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> so i tried just calling $appLicense = $_GET['item_name'] and used the
> name of the item (like "Software License") as the variable like this:
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> $appLicense = $_GET["item_name"];
>
> $error_url = "//the error url";
>
> $key = "";
> $privateKey = "";
>
> if ($appLicense == "Software License A")
> {
> $key = "//the key for Software-A";
> $privateKey = "//the private key for Software-A";
> }
> else if ($appLicense == "Software License B")
> {
> $key = "//the key for Software-B";
> $privateKey = "//the private key for Software-B";
> }
> else
> {
> header("Location: $error_url");
> die;
> }
>
> //remaining lines of code involve the email message
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> but ultimately that didn't work either, which kinda surprised me since
> the data is clearly being used already... i must be calling it
> wrong?... :-/
>
>
>
>
>
>
>
>
> On Tue, Feb 3, 2009 at 8:56 PM, Sherm Pendley <email@hidden> wrote:
>> On Feb 3, 2009, at 7:21 PM, Chunk 1978 wrote:
>>
>>> $appLicense = $_POST["appLicense"];
>>
>> Try this instead:
>>
>> $appLicense = $_GET["appLicense"];
>>
>>> isn't this the correct method to incorporate
>>> customized php variables with the AquaticPrime scripts?
>>
>> It depends. When an HTML form has a "method" attribute with a value of
>> "POST", the form will be submitted using the HTTP POST method, and (in PHP)
>> the form inputs will be found in $_POST.
>>
>> When you link to an ordinary URL with a query string, such as
>> "http://foo.example/whatever.php?appLicense=Bar", the HTTP GET method is
>> used to send the request, and the input from the query string is in $_GET.
>>
>> If you want the receiving script to handle either one, use $_REQUEST, which
>> includes the contents of both $_POST and $_GET, as well as $_COOKIES.
>>
>> sherm--
>>
>>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden