Jump to content


Photo

this script in php how to?


  • Please log in to reply
1 reply to this topic

#1 brazza

brazza
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 27 August 2003 - 10:52 PM

It\'s a script for geeklog. but i want it in a normal php script.
<?phpfunction phpblock_randomQuote() {     global $_CONF;         $result = DB_query("                SELECT * FROM quote                ORDER BY RAND()                 LIMIT 1                ");     $res = DB_fetchArray($result);    $author = ($res[\'author\']) ? $res[\'author\'] : \'anonymous\';    $source = ($res[\'source\']) ? $res[\'source\'] : \'\';    if ($source != \'\' && $res[\'year\'] != \'\') {        $year = ", {$res[\'year\']}";    } else {        $year = \'\';    }    $link = "<a target=\'new\' title=\'$source $year\' href=\'http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q="          . $author . "\'>" . $author . "</a>";    $authorLink = ($author != \'anonymous\') ? $link : \'anonymous\';    $retval = <<<EOF<table>    <tr>        <td>"{$res[\'quote\']}"</td>    </tr>    <tr>        <td align="right">-- <b>$authorLink</b></td>    </tr></table>EOF;    return $retval; }?>

[/code]

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 28 August 2003 - 10:01 AM

Try this

http://www.phpfreaks...orials/51/0.php
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users