in reply to Re^2: get parameter from html page
in thread get parameter from html page

print "Content-type:text/html\n\n";
\n\n is the incorrect header terminator. \r\n\r\n is usually closer, but I admit that I don't know the proper set of characters off-hand, because I never send them directly.
It doesn't matter. You are not sending them directly to the browser. There's still a webserver between the CGI scipt and the browser, and this one fixes up the output from the CGI script, it even changes/adds headers.

Bare newlines are just fine.

Replies are listed 'Best First'.
Re^4: get parameter from html page
by chromatic (Archbishop) on Dec 22, 2006 at 18:02 UTC
    There's still a webserver between the CGI scipt and the browser, and this one fixes up the output from the CGI script, it even changes/adds headers.

    I don't take much comfort in that. Perhaps you could mention said web server and its particular configuration and the cases in which it will not mangle the headers (as I can think of at least one configuration option to prevent Apache httpd from doing so).

Re^4: get parameter from html page
by ali.muzaffar (Initiate) on Dec 22, 2006 at 17:50 UTC
    All, Thanks for the heads up, as I said I am new to Perl, and the code I posted was the best solution I got from a google search on how to retrieve a query string. Unfortunately the web project I was planning to start in Perl sorta got indefinately delayed so no harm done. This has however given me time to learn. Can someone post a good tutorial for me on how to use perl to make webpages? In particular how to integrate perl code in HTML so I can design a layout in HTML and just have dynamically printed lists and article etc. Thanks again