Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    838
    Thanks
    15
    Thanked 9 Times in 9 Posts

    Print Between tags?

    Is there anyway I can get a page (located in a frame) to print the content between to tags.

    For example:

    blah, blahblah, blahblah, blahblah, blah
    blah, blahblah, blah
    blah, blahblah, blahblah, blahblah, blah
    <print>
    THIS CONTENT IS PRINTED
    </print>

    This isn't.blah, blahblah, blahblah, blahblah, blah

    I have a page that has some extra content I don't want when it is going to be printed. Thanks.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #2
    Regular Coder
    Join Date
    Jan 2004
    Location
    Georgia
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <?php
    $content = "blah blah blah";
    print $content;
    ?>



    thats the best i can understand what you have said....
    ~Designer's Toolz~

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    To just hide stuff from a printer is nothing to do with php, but your question is sorta confusing. So I don't know if DsgnrsTLZAdmin answered your question, or if this will
    Code:
    <html>
    <head>
    <style type="text/css">
    @media print {
        .dontPrintMe{display : none;}
    }
    </style>
    </head>
    <body>
    
    <p>blah blah blah <span class="dontPrintMe">You can't print this :p </span> blah blah blah</p>
    </body>
    </html>

  • #4
    Regular Coder
    Join Date
    Jan 2004
    Location
    Georgia
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Reading this again, i think i understand what you mean. But like NightFire said, it has nothing to do with php but if you want to use it? do this:


    <?php
    //this will not be printed.
    print "this will be printed";
    //this will not be printed.
    ?>
    ~Designer's Toolz~


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •