Jump to content
  • 0

Помогите с "событиями"


woofer46
 Share

Question

Подскажите, как я могу сделать такое: над контентом мне надо сделать 3 ярлычка: один должен, при щелчке открывать текстовую версию в ворде, другой, в какой либо pdf читалке(как правило, которая на компе по умолчанию для pdf), текстовую версию, другой, при щелчке должен начать печатать туже текст.версию, как это реализовать?, пишу на php, вот шаблон примерный, ну естевственно место букв - ярлычки

63fd136fdfbf03b4411c08b999b86240.jpg

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Печать страницы:

<?php 


$stripImages = "yes";

$baseURL="http://www.yoursite.com";

$startingpoint = "<!-- startprint -->";
$endingpoint = "<!-- stopprint -->";

error_reporting(0);

$read = fopen($HTTP_REFERER, "r") or die("<br /><font face=\"Verdana\">Sorry! There is no access to this file directly. You must follow a link. <br /><br />Please click your browser's back button. </font><br><br><a href=\"http://miracle2.net/\"><img src=\"http://miracle2.net/i.gif\" alt=\"miracle 2\" border=\"0\"></a>");

error_reporting(1);

$value = "";
while(!feof($read)){
$value .= fread($read, 10000);
}
fclose($read);
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);

function i_denude($variable) {
return(eregi_replace("<img src=[^>]*>", "", $variable));
}
function i_denudef($variable) {
return(eregi_replace("<font[^>]*>", "", $variable));
}

$PHPrint = ("$value");
if ($stripImages == "yes") {
$PHPrint = i_denude("$PHPrint");
}

$PHPrint = i_denudef("$PHPrint");
$PHPrint = str_replace( "</font>", "", $PHPrint );
$PHPrint = stripslashes("$PHPrint");

echo "<base href=\"$baseURL\">";

echo $PHPrint;

echo "<br><a href=\"http://miracle2.net/\"><img src=\"http://miracle2.net/i.gif\" ";
echo "alt=\"miracle 2\" border=\"0\"></a>";
echo "<br/><br/>This page printed from: $HTTP_REFERER";
flush ();
?>

Код не мой, поэтому не проверял на работоспособность.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy