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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output gone wild!

Status
Not open for further replies.

Mute101

Programmer
Jun 28, 2001
428
GB
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?

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."
----------------------------------------
 
you could use in-line css to reduce the size of the font.

The worldpay index page uses style sheets so I would assume it is on yours as well snd why you are getting unexpected results... you could look at the page that is generated and possible use there css stuff.

As far as altering the php template for the space thing if it is from the same template group it is actually a image used for formatting. Anyway there is not much you can do unless you have access to those templates that generate your pages.

 
Ello,

I am using inline css to produce the look and feel of my site during the worldpay process.

I'm not sure I am explaining myself properly so here are some links showing the results pages (ignore the fact that the images are not present)

My Template

Passed through Worldpay

Why is this happening?


----------------------------------------
I was once asked if I was ignorant or just apathetic. I said, "I don't know, and I don't care."
----------------------------------------
 
It isn't in Firefox, unless you've changed something since

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ... smack the fecker
 
It might be an IE specific issue, have a gander at
Desktop Software

Browser issues for IT professionals

If the link doesn't work

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ... smack the fecker
 
sorrry I haven't gotten back to you soon. I had to go out of town.

well if I knew exactly the space you were talking about.
I did notice some poor html

</td>
<!-- End Content Area -->

<!-- Begin Printable Version -->
<table border="0" cellpadding="0" cellspacing="0" width="740">

missing some tags in there

the space below
Thankyou for your order. is
<br><br><WPDISPLAY ITEM="Banner"><br><br>

I would try and fix the html stuff first and see where it take you
 
Hi all,

Thanks for the responses, I did notice there was a LOT of bad html in there which suprises me as it was a template provided by HP!

I have fixed the code and still the problem persists, I'm not sure why you are telling me about the space as its not part of the issue at all but thanks all the same.

I have managed to find out this is an IE specific bug related to the !DOCTYPE line, but I haven't managed to solve the issue.

I will post again if/when I resolve this one as I think it may be useful for others.

Sim

----------------------------------------
I was once asked if I was ignorant or just apathetic. I said, "I don't know, and I don't care."
----------------------------------------
 
It´s a bit freaky, usually IE is very forgiving (a credit to it´s bulky footprint no doubt)

Can you get all your clients to use Firfox instead of IE

;-)
--Paul
Spanish Keyboards are a beach


It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ... smack the fecker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top