Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variables (passback)

Status
Not open for further replies.

KizMar

Technical User
Mar 13, 2002
52
US
I'm having an "I've never done this before" issue:

I'm using 2CheckOut to do credit card verification for me. When the transaction is complete, I'm having them redirected back to my page. They say they pass back the customer's variables that I can pull at that point. The problem is, I have no clue how to grab these variables and basically auto-fill my form.

I haven't the slightest clue what I'm doing, and I've tried several different ways to pull the session variables, none seem to work
___________

Is there a way to pull the URL their sending me so I can tell if they're sending me a POST (query string)?

They make it look like I have to have them pass the query back to a routine... "myroutine.pl"... I think I'm missing a step here. I'm trying to pull the ENV variable right into a PHP page with an existing form. Basically using soemthing like:

&quot;<input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; value=&quot;<?php $_ENV['card_holder_name']; ?>&quot; size=&quot;40&quot; maxlength=&quot;100&quot;>&quot;

But this doesn't work. Does there need to be code at the top of the PHP page that pulls the variables into the page?
___________

I combined a couple posts into one to post on the PHP forum, I was in the Perl forum and that was the wrong place for me...

I'm trying to use PHP to pull session variables and I have no clue what I'm doing.
 
ask them how the variables are coming back (either via POST or in the URL (GET)) or just check the URL. Once that is settled, you should be able to use whatever variable you get to access the session data of that user



Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
It's not coming over in the URL, I can tell that much. Their support sent me this Perl snippet that can be used to pull the variables... does this tell you how it's being passed? I know nothing about Perl though so this means very little to me:


#!/usr/bin/perl -w


&get_input_print;





exit;

### No Need to edit below this line

sub get_input_print {
print &quot;Content-type: text/html\n\n&quot;;
print &quot;<h4>Returned Parameters</h4>&quot;;
my $request_method;
my $size_of_form_information;
$request_method = $ENV{'REQUEST_METHOD'};
if ($request_method eq &quot;GET&quot;) {
$form_info = $ENV{'QUERY_STRING'};
} else {
$size_of_form_information = $ENV{'CONTENT_LENGTH'};
read (STDIN, $form_info, $size_of_form_information);
}
@key_value_pairs = split (/&/, $form_info);
foreach $key_value (@key_value_pairs) {
($key, $value) = split (/=/, $key_value);
$key = lc(&quot;$key&quot;);
$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack (&quot;C&quot;, hex ($1))/eg;
if (defined($FORM_DATA{$key})) {
$in{$key} = join (&quot;, &quot;, $FORM_DATA{$key}, $value);
} else {
$in{$key} = $value;
}
print &quot;<br><b>$key</b> - $in{$key}&quot;;
}
}
 
They say:

&quot;
An API (Application Programming Interface) is used in many different contexts in this industry. To clear this up with our service read below:

We offer a Common Gateway Interface (CGI). This means your site will need to contain an HTML form or link with cgi parameters appended which passes the correct parameters (and your customer) to our site for checkout. Passing in the Proper Parameters will result in your customer going through the rest of our checkout process (such as entering their credit card information), and after verification, a successful sale.
&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top