I have used the CGI module quite a lot but never encountered this before.
A submission to Paypal returns the name of a script to run when a transaction is successful (success.cgi), with a few vars in the query string.
This is the address bar display, with the site name removed.
The script starts the same way as countless other scripts.
It appears that the query string is not being decoded as
only prints
Print the query string
So the query string contains the expected data, there is no line feed etc at the end causing the problem.
If I remove the last char from the address line, whatever it might be and refresh the page, the query string is decoded.
What am I missing?
Keith
A submission to Paypal returns the name of a script to run when a transaction is successful (success.cgi), with a few vars in the query string.
This is the address bar display, with the site name removed.
Code:
[URL unfurl="true"]http://www.sitename/cgi-bin/success.cgi?toot=tutty/enchanti.tut&comp=chant&ino=5016&[/URL]
The script starts the same way as countless other scripts.
Code:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use Time::Local;
use warnings;
use strict;
use CGI;
use DBI;
use HTML::Template;
my $query = new CGI;
print "Content-type: text/html\n\n"; # prepare for HTML output
my $COMPANY=$query->param('comp') || '';
my $TUTNAME=$query->param('toot') || '';
my $INO=$query->param('ino') || '';
It appears that the query string is not being decoded as
Code:
print "co $COMPANY<br>tut $TUTNAME<br>in $INO<br>";
only prints
Code:
co
tut
in
Print the query string
Code:
print $ENV{'QUERY_STRING'};
=
toot=tutty/enchanti.tut&comp=chant&ino=5016&
So the query string contains the expected data, there is no line feed etc at the end causing the problem.
If I remove the last char from the address line, whatever it might be and refresh the page, the query string is decoded.
What am I missing?
Keith