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

Help needed on “Quick View Plus” related problem

Status
Not open for further replies.

lcs01

Programmer
Joined
Aug 2, 2006
Messages
182
Location
US
One of my company's pages has a link to allow uses to download a set of data in csv (Comma Separated Value) format. The corresponding implementation is like this (the source code with an extension name as 'csv', instead of a conventional 'pl'):

Code:
my $csv = Text::CSV_XS->new({
  'quote_char'  => '"',
  'escape_char' => '"',
  'sep_char'    => ',',
  'binary'      => 1
});

$csv->combine(@headers);
print $csv->string(),"\r\n";

$csv->combine(@columns);
print $csv->string(),"\r\n";

The above code works fine. Now, according to a new spec, the code needs to check a flag first:

Code:
if($flag == 1) {
  $csv->combine(@headers);
  print $csv->string(),"\r\n";

  $csv->combine(@columns);
  print $csv->string(),"\r\n";
}
else {
  my $msg = "Some instructions. Click ". a({-href=>'/anotherPerlCode.pl'}, 'here');
  print start_html();
  print  "$msg<p>\n";
  print “@columns”;
  print “end_html();
}

In a test run, when $flag = 0, I did get a page shown '$msg' with 'here' underlined, indicating it is a hype link.However, the link is NOT clickable! I am using IE 6 and I noticed that on the lower left conor of my IE, it reads: “Quick View Plus – XML with DcoType HTML”. I also noticed that when $falg == 1, then the lower left conor message reads: “Quick View Plus – 7-Bit Text File”.

My question is when $flag = 0, how do I make a page in a conventional html format so that the link is clickable? I tried to find some info through google, but went nowhere.

Thank you very much for your help.
 
my $msg = "Some instructions. Click <a href=\"/anotherPerlCode.pl\">here</a>";

HTH

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Thank you for your help.

I tested your code. Unfortunately, it does not work - it has the exact same problem.

BTW, I don't see what the difference between yours and mine is. You used a plain html while I used CGI.pm..a(), which should be identical.
 
What content-type header are you printing to the browser at the start of your output?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Hi, Paul,

Thank you for your message. I am so sorry that I did not get to you promptly. I was pulled away by other tasks.

Back to your question, the contenttype header is 'text/html', which is the default while calling start_html().

Thanks again.
 
try text/csv and see if that cures it, or text/plain even

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Maybe that Quick View Plus program is messing with some settings. Try and disable it or something.

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top