Hi,
I have written a script to deal with the end of payment process at WorldPay. Amongst other things this script takes a html template and replaces blocks with the order info then prints the template to screen.
My problem lies in the fact that the worldpay server seems to output one line before enacting my script. This seems to change all my formatting (all the text becomes much larger) which means the page doesnt look good at all.
Is there any way I can solve this using code?
and the createTemplate subroutine looks like this;
Not sure if my current code is worth showing but there it is and any help would be appreciated.
Sim
----------------------------------------
I was once asked if I was ignorant or just apathetic. I said, "I don't know, and I don't care."
----------------------------------------
I have written a script to deal with the end of payment process at WorldPay. Amongst other things this script takes a html template and replaces blocks with the order info then prints the template to screen.
My problem lies in the fact that the worldpay server seems to output one line before enacting my script. This seems to change all my formatting (all the text becomes much larger) which means the page doesnt look good at all.
Is there any way I can solve this using code?
Code:
#!/usr/local/bin/perl
use CGI;
use FileHandle;
use Fcntl;
$query = new CGI(STDIN);
print $query->header;
$Stage = $query->param("Stage");
if ($Stage eq "Kits") {
$templateFile="$ENV{'DOCUMENT_ROOT'}/hp/kitsTpl.html";
&createTemplate;
&createTable;
&createSession;
&createHidden;
&replaceTemplate;
print $resultPage;
}
and the createTemplate subroutine looks like this;
Code:
sub createTemplate {
open(INFILE,"<$templateFile");
@templatePage=<INFILE>;
close(INFILE);
#condense page array into one scalar variable
$resultPage=join("",@templatePage);
}
Not sure if my current code is worth showing but there it is and any help would be appreciated.
Sim
----------------------------------------
I was once asked if I was ignorant or just apathetic. I said, "I don't know, and I don't care."
----------------------------------------