Posted: Thu 2. Nov 2006, 11:16
777 für print.php hat auch nicht geholfen.
Funktioniert nicht im IE 6 und Opera 9.0x und FF 1.5x
Funktioniert nicht im IE 6 und Opera 9.0x und FF 1.5x
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
(1) $HTTP_REFERER is empty. You may be able to fill it with $_SERVER['HTTP_REFERER']
(2) You have apache authentication and, say, an .htaccess file in the directory,
for example. Because your site is requesting authentication, you will not be able
to proceed through the phprint.php script.
(3) Look in your php.ini file and see that allow_url_fopen = On
(4) Run "ulimit -a" in a terminal window. Make sure that "open files" is not set to 0 (zero).
Code: Select all
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /mnt/kw1/03/398/00000015/htdocs/phpwcms/print.php on line 94Code: Select all
<?php
// START settings
$sitename="My Site";
$logoimage="img/print_logo.gif";
$stripImages = "no";
$homepage="http://localhost";
// END settings
echo "<html><head>";
echo "<title>$sitename | Print version</title>";
echo "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>";
echo "<style>body{font:12px Verdana,Arial,Sans-serif;}div{padding:10px;}.printDiv{border:1px solid #ccc;width:550px;}.printBottom{text-align:center;font-size:11px;border-top:1px solid #ccc;width:90%;}</style>";
echo "</head><body> ";
if (is_null($_SERVER['HTTP_REFERER'])){ print "<h1>Oooops...you can't access PRINT PAGE directly!</h1>[<a href='$homepage'>Home Page</a>]";}
else {
$startingpoint = "<!-- startprint -->";
$endingpoint = "<!-- stopprint -->";
$read = fopen($_SERVER['HTTP_REFERER'], "rb");
while(!feof($read)){$value .= fread($read, 4096);}
fclose($read);
$article = $_SERVER['HTTP_REFERER'];
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);
function i_clear($variable)
{return(eregi_replace("<img src=[^>]*>", "", $variable));}
function i_clearf($variable)
{return(eregi_replace("<font[^>]*>", "", $variable));}
$PHPrint = ("$value");
if ($stripImages == "yes") {
$PHPrint = i_clear("$PHPrint");}
$PHPrint = i_clearf("$PHPrint");
$PHPrint = str_replace( "</font>", "", $PHPrint );
echo "<div class='printDiv'><p><img src=$logoimage alt='$sitename' />";
echo "<div>$PHPrint</div>";
echo "<div class='printBottom'>";
echo "This article comes from <strong>$sitename</strong> site.";
echo "<p>The URL for this article is: <a href='$article'> $article</a></p>";
echo "<form><input type='button' value='Print this page' onclick='window.print()' /></form>";
echo "</div></div>";
echo "</body></html>";
flush ();
}
?>
Code: Select all
echo "Der direkte Link zu dieser Seite lautet:<br><a href='".$_SERVER['HTTP_REFERER']."'>". $_SERVER['HTTP_REFERER']."</a><br><br>";Goran wrote:...but take into consideration what Oliver say about this code/script: "..this peace of code is totally nonsense! Often Referrer does not work! And there is a built-in print function."
These are the line 65-68:Warning: fopen(http://www.scholtysik.net/) [function.fopen]: failed to open stream: Connection timed out in /www/XXXXXXXX/domain/htdocs/print.php on line 65
Warning: feof(): supplied argument is not a valid stream resource in /www/XXXXXXXX/domain/htdocs/print.php on line 67
Warning: fread(): supplied argument is not a valid stream resource in /www/XXXXXXXX/domain/htdocs/print.php on line 68
Code: Select all
$read = fopen($_SERVER['HTTP_REFERER'], "rb");
$value = "";
while(!feof($read)){