Forum Moderators: open
I’m having a problem with a perl script that gathers and emails form data and then returns a Thank You page to the user. The problem may actually be with the browser as it works fine in IE6 and 7 but not in Mozilla Firefox. In Firefox, the Thank You page is just rendered as HTML code. However, the form data is still sent by email. Any ideas how I can fix this?
Look for this line (or something like it) in your script:
print ("Content-type: text/html\n\n");
The thank you note is a regular html page enclosed in a subroutine. Here’s the code, minus the content.
sub thank_you {
print <<EndStart;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sample Request Thank You</title>
</head>
<body>
</body>
</html>
EndStart
exit(0);
}
Does the doc type declaration make a difference?
Maybe we’re on to something.
Downloaded the "Live HTTP Headers" extension as you suggested.
For the “Thank You Page” returned by the perl script, here’s what comes up under Page Info>Headers>Response Headers:
Response: HTTP/1.1 200 OK
Date: whatever
Server: Apache/1.3.33 (Unix)
Keep-Alive: timeout=2, max=200
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain
Is the problem the Content-Type: text/plain? Should it be text/html? If so, how do I change it?
Does it matter that I ftp’d the perl script as ASCII not binary?