| Code: : |
<?PHP if (eregi("block-pic2.php", $_SERVER['PHP_SELF'])) { header("Location: index.php"); } $content = ""; $content = "<A HREF='http://www.wenhui.ch/pics/misc/big.jpg'>\n"; $content .= "<IMG SRC='http://www.wenhui.ch/pics/misc/small.jpg'></A>\n"; $content = "-- Test photo --"; ?> |
| Code: : |
| <?php /************************************************************************/ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License. */ /* please credit me, it's my only block */ /* Copyright Robert J. Sori, Las Vegas Nevada */ /************************************************************************/ if (stristr($_SERVER['SCRIPT_NAME'], "block-randomphotos.php")) { Header("Location: index.php"); die(); } mt_srand((double)microtime()*1000000); $imgs = dir('pics/random'); while ($file = $imgs->read()) { if (eregi("gif", $file) || eregi("jpg", $file)) { $imglist .= "$file "; } } closedir($imgs->handle); $imglist = explode(" ", $imglist); $a = sizeof($imglist)-2; $random = mt_rand(0, $a); $image = $imglist[$random]; $asin = explode(".", $image); $content .= "<center><a href=\"picshow.php?show=pics/random/$image\">"; $content .= "<img src=\"http://www.wenhui.ch/pics/random/$image\" border=\"0\" width=\"120\" alt=\"\"><br><br></center>"; ?> |
| Quote: : |
Warning: dir(pictures): failed to open dir: No such file or directory in /home/www/a19681cb40e9cccbf716f537e7798dce/web/blocks/block-randomphotos.php on line 17 Fatal error: Call to a member function on a non-object in /home/www/a19681cb40e9cccbf716f537e7798dce/web/blocks/block-randomphotos.php on line 18 |
| Code: : |
$imgs = dir('pics/random'); |
| Code: : |
| <?php /************************************************************************/ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License. */ /* please credit me, it's my only block */ /* Copyright Robert J. Sori, Las Vegas Nevada */ /************************************************************************/ if (stristr($_SERVER['SCRIPT_NAME'], "block-RandomPicture.php")) { Header("Location: index.php"); die(); } mt_srand((double)microtime()*1000000); $imgs = dir('pictures'); while ($file = $imgs->read()) { if (eregi("gif", $file) || eregi("jpg", $file)) { $imglist .= "$file "; } } closedir($imgs->handle); $imglist = explode(" ", $imglist); $a = sizeof($imglist)-2; $random = mt_rand(0, $a); $image = $imglist[$random]; $asin = explode(".", $image); $content .= "<center><a href=\"picshow.php?show=pictures/$image\">"; $content .= "<img src=\"pictures/$image\" border=\"0\" width=\"120\" alt=\"\"><br><br></center>"; ?> |
| Code: : |
<?php if (!isset($mainfile)) { include("mainfile.php"); } $index = 0; include("header.php"); OpenTable(); $sl = $show; echo " <center><h3><a href=\"javas c r i p t:history.back()\">Go back!<br><br> <img src=$sl border=\"2\" width=\"100%\"></a></h3> </center>"; Closetable(); include("footer.php"); ?> |