SSI,build,your,website,using,headers,footers,
Quick Search for: in language:   
SSI,build,your,website,using,headers,footers,
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Perl Stats

 Code: 48,566 lines
 Jobs: 164 postings

 

You are in:

 
Login


Latest Code Ticker for Perl
randpass
By Joel Addams on 2/27


Programming Jargon, (with search)
By Benjamin Bechard on 2/26


CGI-Fortune with Extras
By Slava Shirokov on 2/23


TKase_tags.pl
By Incipient Cipher on 2/23


Printer Friendly Page v2
By Richard Leishman on 2/20


Click here to see a screenshot of this code!Centerized a String
By ram2i on 2/19

(Screen Shot)

Click here to see a screenshot of this code!Pyxus Pure Perl Web Server
By Alan Mollenkopf "BigAL" on 2/18

(Screen Shot)

Printer Friendly Page
By Richard Leishman on 2/16


Form to File
By Richard Leishman on 2/16


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 

 
 

   

Printer Friendly Page

Print
Email
 
VB icon
Submitted on: 2/16/2002 10:14:02 PM
By: Richard Leishman  
Level: Intermediate
User Rating: Unrated
Compatibility:5.0 (all versions), Active Perl specific, 4.0 (all versions), 3.0 (all versions), Pre 3.0

Users have accessed this code 133 times.
 

(About the author)
 
     When you build your website using SSI headers and footers this script is really good because it dont insert the SSI headers and footers so all you get is the main content and what small header and footer you have set in this script. Like hotmain uses smaill headers and footers for their printer friendly pages, best for shtml and txt files! this could easiely be chaned so it can be used on a perl resource website for showing the source code of scripts without having to have a seperate file for each cgi script (eg, script.cgi for running and script.txt so people can see the code)
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    =**************************************
    = Name: Printer Friendly Page
    = Description:When you build your websit
    =     e using SSI headers and footers this scr
    =     ipt is really good because it dont inser
    =     t the SSI headers and footers so all you
    =     get is the main content and what small h
    =     eader and footer you have set in this sc
    =     ript. Like hotmain uses smaill headers a
    =     nd footers for their printer friendly pa
    =     ges, best for shtml and txt files! this 
    =     could easiely be chaned so it can be use
    =     d on a perl resource website for showing
    =     the source code of scripts without havin
    =     g to have a seperate file for each cgi s
    =     cript (eg, script.cgi for running and sc
    =     ript.txt so people can see the code)
    = By: Richard Leishman
    =
    = Assumes:all you do is run the script l
    =     ike this script.cgi?address/to/ssi-page.
    =     shtml
    =
    =This code is copyrighted and has    = limited warranties.Please see http://w
    =     ww.Planet-Source-Code.com/xq/ASP/txtCode
    =     Id.285/lngWId.6/qx/vb/scripts/ShowCode.h
    =     tm    =for details.    =**************************************
    
    #!/path/to/perl
    ##################
    # Please link me on your website
    # Http://www.L22.co.uk
    ##################
    #Starting the html page
    print "Content-type: text/html\n\n";
    #Header of your printer friendly page goes here
    print "<!-- HEADER HTML -->\n";
    #open the file at the address after the question mark
    open FILE, "./$ENV{'QUERY_STRING'}" or print "[ERROR: Cannot open page]";
    while (<FILE>) {
    print "$_";
    }
    close(FILE);
    #Footer of your printer friendly page goes here
    print "<!-- FOOTER HTML-->\n";


Other 2 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The codewith your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Perl Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.