Er, I think Randal's misunderstood something, but since it's Randal, I'll just re-read your post...

OK, I'm gonna go out on a limb here (expecting to be thrashed at any moment... :)

As far as I can see, your forms/links do not pass any values to the server in the buffer or query string. All they do is serve one PDF file.

If so, all you need in your script is:

print "Content-type: application/pdf\n\n"; open(PAGE, "</home/username/pdf/ho99-6a.pdf") || die("Can't open file +- $!"); print while (<PAGE>); close(PAGE); exit(0);

You would only need to read the query string / buffer if you actually sent any information.

The only time I would think you might do this is if the document is stored outside the web root and you can't symlink to it.

What would involve query_string / buffer would be if you sent a variable to the script. ie, the html was something like:

<html> <body> <a href="/~newbie/cgi-bin/getpdf2.pl?document=ho99-6a.pdf">Click Here +for Test 1</a><p> <FORM METHOD="POST" ACTION="/~newbie/cgi-bin/getpdf2.pl"> <INPUT TYPE="hidden" NAME="document" VALUE="ho99-6a.pdf"> <INPUT TYPE="SUBMIT" VALUE=" Click here for test 2 "> </FORM> <p> <FORM METHOD="GET" ACTION="/~newbie/cgi-bin/getpdf2.pl"> <INPUT TYPE="hidden" NAME="document" VALUE="ho99-6a.pdf"> <INPUT TYPE="SUBMIT" VALUE=" Click here for test 3 "> </FORM> </body> </html>

Please kick me. I must be missing something here?!?

cLive ;-)


In reply to Re: Odd difference between by cLive ;-)
in thread Odd difference between by Xxaxx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.