Page 1 of 1

need link changing code

Posted: Fri Oct 10, 2008 3:52 am
by max196
I have over 500 pages on my Game website. Now, I want to place a top-10 games section in each page. I will change top10 links weekly. Is there any php code so that The only top 10 content of all pages changes simultaneously. :?: Please Help Me!

Thank You!

Re: need link changing code

Posted: Fri Oct 10, 2008 4:03 am
by mattcooper
Sounds like you want an "included" file here:

Code: Select all

 
<?php
    //main file
   echo "<h1>My main page</h1>";
   require_once ('/path/to/top10.php');
?>
 
Put that call on all of your pages and then you'll only need to edit the 'top10.php' file - all pages will receive the update immediately.

Re: need link changing code

Posted: Fri Oct 10, 2008 12:17 pm
by max196
Thank You, for your precious suggestion! :D

But my problem is that, all my pages are in html format & i want to use the same html format pages. I don't want to change my all pages to .php extension. Can i use this php code in my html pages?

Still, I want to create a simple column of top 10 list in right side of each page. Otherwise, suggest me any other best method.

Thank You!

Re: need link changing code

Posted: Fri Oct 10, 2008 12:23 pm
by aceconcepts
Yes you can use PHP code in HTML page. Simply type it like this:

Code: Select all

<?PHP include"file.php"; ?>
However, how is you site structure? How are pages called?