I know I messed this up badly and would like to know how to fix this // Total random Start function randomQuote ($file) { $f = file($file); $k = array_rand($f); $q = $f[$k]; } $proxiesrandom = randomQuote("random_link.txt"); $sRow = $proxiesrandom; $random = $sRow['randomQuote']; $tpl->parse( 'random', array( 'random' => $q, ) ); // Total random End PHP: I have a file with <? function randomQuote ($file) { $f = file($file); $k = array_rand($f); $q = $f[$k]; echo $q; } ?> PHP: A text file with random quotes in a normal situation I would be able to use this line <? randomQuote("random_link.txt"); ?> PHP: but since my design uses tpl I cant and I need to be able to run this in a tpl file but cant figure out how to add the above into my current design using the parse format from above.
why not doing it with javascript instead, you can add all lines to a javascript and the javascript returns every page a random line! it's just quick tought!