Announcement

Collapse
No announcement yet.

Wondering if...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wondering if...

    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:
    Code:
    <?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
    Code:
    echo "$quote";
    with some return the value, so on the index.shtml file displays it. Any help?
    Shane
    CIO, FrakMedia.net
    Director of Information, BattlestarForum.com

  • #2
    I don't think it's possible to do php and ssi in the same document.

    Comment


    • #3
      Oh dart. Thanks anyway.
      Shane
      CIO, FrakMedia.net
      Director of Information, BattlestarForum.com

      Comment


      • #4
        I think you can. But take out the

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

        part.

        Then just use

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

        Comment


        • #5
          w00t! Thank you very much.
          Shane
          CIO, FrakMedia.net
          Director of Information, BattlestarForum.com

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X