PDA

View Full Version : Wondering if...


Shane
Sat 27th Jan '01, 2:48am
Ok. I have this as a situation. The mian page is index.shtml and when I want the page to load, I want this php file executed: <?php

require("something");

$Result = mysql_query("SELECT * FROM quote_rotation");
$total_rotation = mysql_num_rows($Result);

$rand = rand(1,$total_rotation);

$result = mysql_query("SELECT quote FROM quote_rotation WHERE quoteid='$rand'");
$row = mysql_fetch_row($result);
$quote = $row[0];

if ($quote != "") {
echo "$quote";
} else {
header ("Location: http://www.tribalwar.com");
}


?>

but I want to replace

echo "$quote";


with some return the value, so on the index.shtml file displays it. Any help? :D

YellowKard
Sat 27th Jan '01, 3:25am
I don't think it's possible to do php and ssi in the same document.

Shane
Sat 27th Jan '01, 5:02am
Oh dart. Thanks anyway.

JohnM
Sat 27th Jan '01, 11:31am
I think you can. But take out the

} else {
header('...');

part.

Then just use

<!--#INCLUDE FILE="quotes.php">

Shane
Sat 27th Jan '01, 1:24pm
w00t! Thank you very much. :D