[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Sending a serialized and url encoded array through Paypal and out again through IPN

Asked by lucidica in PHP Scripting Language, Payment Processing Recommendation and Integrating, E-Commerce

Tags: php, Paypal, IPN

Hi there

I have a multiple page form that collects data and sends it to another page where the user can review the submitted data and use a Paypal buy button to purchase my service.

I've set up an IPN script that is successfully emailing me once a purchase has been made, however, I also need it to send me the values from the multiple page form mentioned before.

As I understand it, you are only allowed one custom field associated with a Paypal button - named "custom"; so I need to put the values for my entire form through Paypal using this one field.

I have turned the form variables into a string and passed that through, successfully, although I need to be able to split the variables out again on my IPN listener page and display them in an mail, one on each line preceeded with some text.
eg Email: $submit['email'];\n
     Domain: $submit['domain'];

I think I need to pass the values through as an array, rather than a string, so I can pull the separate values out of the array at the other end.  I've tried to serialize the array, and encode and then serialize (and decode/deserialize at the other end) but it's just coming out blank.
I think I also need to pull the values out of the array and set them as variables before I can use them in the mail function.

I've tried a great deal of things to try and get this to work, but I think most of what I've tried is equally wrong/incorrect as what I've got at the moment, so there's no point in me trying to list it all!

(One thing to note, though; when I use serialize and then unserialize on the page with the Paypal button, it works fine, but if I encode and then decode while serializing/unserializing, I always get a blank output.  Taking the encode/decode out of the array to pass through Paypal is making no difference, so I've left it in as I think this is the correct way to do it.)


I've pasted relevant bits of my code below.


Thanks in advance!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
/////// The page with the Paypal button ///////
 
///// Top of the page
 
// Turn into an array
$signup = array('email' => $email, 'firstname' => $firstname, 'lastname' => $lastname, 'company' => $company, 'domain' => $domain, 'extension' => $extension, 'template' => $template,  'banner' => $banner);
 
// Serialize and encode it
$signup_s = urlencode(serialize($signup));
 
///// Within the Paypal button form
 
<input type="hidden" name="custom" value="<?php echo $signup_s ?>" />
 
 
 
/////// The Paypal IPN listener page ///////
 
// Decoding and unserializing the array
$signup = urldecode(unserialize($_POST['custom'])); 
 
// Printing the array into the body of the mail
$mail_Body = print_r($signup, true);
mail($mail_To, $mail_Subject, $mail_Body, $mail_From);
[+][-]11/04/09 10:11 AM, ID: 25742104Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 10:29 AM, ID: 25742283Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 10:35 AM, ID: 25742344Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 10:56 AM, ID: 25742586Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 11:08 AM, ID: 25742707Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 03:51 PM, ID: 25745460Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 04:47 PM, ID: 25745808Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 02:59 AM, ID: 25748242Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 11:16 AM, ID: 25762160Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: PHP Scripting Language, Payment Processing Recommendation and Integrating, E-Commerce
Tags: php, Paypal, IPN
Sign Up Now!
Solution Provided By: lucidica
Participating Experts: 1
Solution Grade: A
 
[+][-]11/06/09 11:21 AM, ID: 25762212Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 11:22 AM, ID: 25762224Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625