SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict SniperUK's Avatar
    Join Date
    Jul 2000
    Location
    UK
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Is there ascript or some one who could write me a script which can let my vistors make the current page a prinable version. Thanks alot also here a great email the current page to a friend script it auto inserts the current page in
    the form. script code here it comes

    <?php
    /* Put the url to your site here so that if someone finds your tellafriend
    page without linking to it they will simply be telling their friend about your main page
    */
    $yoursite = "http://www.sitepoint.com";


    // Thats all the editing that is necessary unless you want to mess with the html

    $referer = getenv("HTTP_REFERER");
    if (isset($referer)==0 || $referer=="") {
    $referer = $yoursite;
    }
    if (isset($action)==0 || $action=="") {
    ?>
    <html>
    <head>
    <title>Send page to a friend</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF">
    <form method="post" action="<?php echo $PHP_SELF;?>" name="">
    <table border=0 cellpadding=4 cellspacing=1 width="100%">
    <tbody>
    <tr>
    <td colspan=2><font class=thtcolor color=#000000 face="verdana, arial, helvetica, sans-serif" size=2><b>Send This Page To A
    Friend</b></font></td>
    </tr>
    <tr>
    <td><font face="verdana, arial, helvetica, sans-serif" size=2><b>Your Name/b></font></td>
    <td>
    <input maxlength=100 name=fromname size=25>
    </td>
    </tr>
    <tr>
    <td><font face="verdana, arial, helvetica, sans-serif" size=2><b>Your Email (so your friend can reply to you)/b></font></td>
    <td bgcolor="#f5f5f5">
    <input maxlength=100 name=fromemail size=25>
    </td>
    </tr>
    <tr>
    <td><font face="verdana, arial, helvetica, sans-serif" size=2><b>Send To (Person's Name)/b></font></td>
    <td>
    <input maxlength=75 name=sendtoname size=25>
    </td>
    </tr>
    <tr>
    <td><font face="verdana, arial, helvetica, sans-serif" size=2><b>Send To (Email Address)/b></font></td>
    <td bgcolor="#f5f5f5">
    <input maxlength=100 name=sendtoemail size=25>
    </td>
    </tr>
    <tr>
    <td><font face="verdana, arial, helvetica, sans-serif" size=2><b>Subject/b></font></td>
    <td>
    <input maxlength=100 name=emailsubject size=25 value="Mail a friend">
    </td>
    </tr>
    <tr>
    <td valign=top><font face="verdana, arial, helvetica, sans-serif" size=2><b>Message/b></font></td>
    <td>

    <textarea cols=35 name=emailmessage rows=6>I thought you might be interested in reading this web page:
    <?php echo $referer;?></textarea>
    </td>
    </tr>
    </tbody>
    </table>
    <br>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr align="center">
    <td>
    <input type="hidden" name="action" value="sent">
    <input type="hidden" name="redirect" value="<?php echo $referer;?>">
    <input type="submit" name="Submit" value="SEND EMAIL NOW! ">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    <?php } ?>

    <?php
    if ($action=="sent") {
    mail($sendtoemail, $emailsubject, $emailmessage, "From: \"$fromname\" $fromemail\n");
    ?>
    <html>
    <head>
    <title>E-mail sent!</title>
    <meta http-equiv="refresh" content="3;URL=<?php echo $redirect;?>">
    </head>

    <body bgcolor="#FFFFFF">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <center>
    <font face="Verdana, Arial, Helvetica, sans-serif">We have sent an e-mail to <?php echo $sendtoemail;?>. You will now be returned to the page you came from.</font>
    </center>
    </td>
    </tr>
    </table>

    </body>
    </html>
    <?php } ?>

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use SSI then there's an easy way. Replace the SSI call(s) output (it's always the same so it should be easy) with maybe a small black and white logo of yours. Package that all up into a PHP page and you've got a home-made print this page script.

    If you don't use SSI then it may be a bit harder but you can still use the same technique.


Bookmarks

Posting Permissions

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