View Full Version : Inserting random .php topics into a .htm page


Freakindj
07-04-2005, 09:54 AM
I trying to find information on inserting a random topic from my .phpbb forums into my .htm pages

so far this is what I have come up with

[COLOR=Red]<td width="20%">
test
<?php
$dl = mysql_connect('localhost', 'xxxxx_xxxxxx', 'xxx');
if($dl){
$query = "SELECT count(phpbb2_posts_text) as phpbb2_posts_text";
$result = mysql_query($query, $dl);
$value = mysql_fetch_row($result);
srand(1000000*microtime());
$query = "SELECT phpbb2_posts_text, href FROM banners WHERE id=".rand(1, $value['phpbb2_posts_text']);
$result = mysql_query($query, $dl);
$value = mysql_fetch_row($result);
mysql_close($dl); ?>


<?=$value['phpbb2_posts_text']?>



<?php } // end of if($dl) ?>

</td>[/COLOR]

Has anyone ever tried this before

crodream
07-04-2005, 11:45 AM
html documents don't process php code, you must have .php extension or you must make some adjustments on apache server...if you really need this make normal php page and use mod rewrite and make this page .htm in .htaccess

don't complicated things, php page's have .php, html page's .htm or .html ;)

Freakindj
07-04-2005, 03:16 PM
I like to use Arelis

So what I would like to do is write a php script I can insert into the link page templets that will generate querrys from mysql data base that will imput some nice google food on the left hand colum of my link pages.