Comments

Jay Gladwell wrote on 2/14/2004, 6:19 AM
Although this has nothing to do at all with video... what seems to be the problem you're having? Do you have any knowledge of html?

J--
statas wrote on 2/14/2004, 10:38 AM
well it has something to do with video because i'm trying to take still frames from my videos and display them randomly on my video page. the problem is when i open the file in notepad, i get jibberish.
Jay Gladwell wrote on 2/14/2004, 10:53 AM
You should get:

<?php

/*

Copyright (c) 2002 Hiveware. All Rights Reserved.

Hiveware makes no representations or warranties about
the suitability of the software, either express or
implied, including but not limited to the implied
warranties of merchantability, fitness for a particular
purpose, or non-infringement. Hiveware shall not be
liable for any damages suffered by licensee as a
result of using, modifying or distributing this
software or its derivatives.

*/

// Modify the following line before using this script
$folder = "change_this";

$fileList = array();
$handle = opendir($folder);
while (false !== ($file = readdir($handle) ) ) {
if ( substr($file, -4) == ".gif" || substr($file, -4) == ".jpg" ) {
$fileList[count($fileList)] = $file;
}
}
closedir($handle);
$randNum = rand( 0, (sizeOf($fileList) -1) );
if ( substr($fileList[$randNum], -4) == ".gif" ) {
header ("Content-type: image/gif");
} elseif ( substr($fileList[$randNum], -4) == ".jpg" ) {
header ("Content-type: image/jpeg");
}
readfile($fileList[$randNum]);
?>

Did you get this?

J--
BillyBoy wrote on 2/14/2004, 11:13 AM
The image randomizer you picked REQUIRES PHP to be on your Web server. While many ISP's have it installed not all do. Check first to be sure it is installed and you have permission to use it.

Next this line in the script: $folder = "change_this";
needs to point to the path you put the script and images

So in any text editor like Notepad change that line, save, load to your web server, then also upload the images to the same path and then see if it works.

You don't need to know how the rest of the scipt works, there's nothing else you can change unless you know Java Scripting.
statas wrote on 2/14/2004, 12:03 PM
no, i get this (below). i tried to use the script you posted and it didn't work. i opened it in notepad and changed the "modify this" line to the url of the folder (which i'm not sure is correct). then uploaded the script to the folder and changed the name to random.php (and deleted the .txt at the end). i made an html page with the script url in place of the image, but it doesn't work. any ideas?


‹ í”Mo1†sÝýSÔÃñ±D HMiTåÒC?¤\«¨2ì,8]ì•í¥¥Mþ{_/$Aiõ’ô2ðÎø?×3ÎxP/ëƒ'#åùøøø “ñIû?m×ñW>9:@`t29O&ñùh4Îñýt–îi|P%eÍCZY>‡¡çåõFŸ¦Éðç¶Þ8½XÊæ]:Âhè?^ó7åx@o«Š.bÐÓ{vk.ô hÜn •úÊžŒ%ǵ˦­ñd!Á)4ÔÌ6!MÂ’É7:¨™®tØ?-©}dËÕzÄkGü=ŠE‘4Ñ«ºÒ\ôH›yÕÚ,hÖ”Té•\P°­Ì.3Mö
£ÂŠÝ|‰å®h?JLT/áQQ­\Ðó¦R¨U7®¶>1Öôµ)ò
çÜu‰üR¡MÑÁŒÓ¤ÒjVñVÍl¨P+µ@eß”%;¸›m`tÎÆ3“B+Ògkª½5ò=ZÙB—›x4ˆÚ§qƸKíÓä¶A1¬1š‚?^£Ñköƒ»™ã„‡ô¡k;RÚª²ß¢N¥
Ã-Lò¶h«L~ît?Á¼D&DiJ?Ø«‰áÎiCºâ÷ð„`ìë&ëžâ)²
œzJ¶fSh—í$º§„,±‡²RUžéÅtJY«‚lǪh³·û»_?Ó$Ñ%eèÙgß&÷¨Ü%ìíºìÐõõßÂWõ¢³S¹wûyn²»u÷ÕÛÜ'7i|Ï+{ßM<nNñ±YE¯ø•QÞ£Ìëü©Ü£þÆ‘þ›í¶ö­ÈåÃCl].Ñ4;ëœ[pµúaSó+Ü_\œaÌ‹Ê7ÄèÞ¿ëïuáQý«šÛñ"ª"ŠþI)goÒÿýÏ%‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ D~ŠoÛ³ (
statas wrote on 2/14/2004, 12:05 PM
i believe php is installed on my web server, but i'll double check that with the host admin.