PHP Code - HELP!

Discussion in 'Off Topic' started by lance, Mar 21, 2005.

  1. lance

    lance New Member

    PHP Code - HELP!

    Hi!

    I am having some trouble with the following code:

    <?php
    if(!$page || $page == "") {$pages = "default";} ?><?php include ("$page.html"); ?>

    Now I've been told to replace "page" with something like an initial say e.g - site is called sims site then use ss. Then I was told to replace "default" with the page location which first appears when you go to the site with the ?no bit.

    Are you lost? If not:

    Then I was told to replace page.html with the extention of the pages you want the content to appear on e.g - so if my pages have the extension .php i'd have to add that....

    But what I want to do is make one page and use this code so all that happens is the content changes, which would save me editting each menu on each page one-by-one...

    Does anyone know PHP and can help? Oh yeah - Am I supposed to get rid of these >> " << because if so then im an idiot! lol!


     
  2. ManagerJosh

    ManagerJosh Benevolent Dictator Staff Member

    What's your objective Lance?
     
  3. lance

    lance New Member

    I want to make it so I don't have to edit each page individually. So what your supposed to do is add this code and then the whole website runs on one page but just the main content changes, where this code should be added....

    Not sure if you understand that...

    But, I dont know how to edit...
     
  4. ManagerJosh

    ManagerJosh Benevolent Dictator Staff Member

    So your talking more about Dynamic Content Pages? Or are you talking about includes, where you modify one set of pages, it modifies all pages with that file?
     
  5. lance

    lance New Member

    The second one..
     
  6. Mirelly

    Mirelly Active Member

    Give in Josh ... Lance doesn't want to answer in case he gives the game away. :p
     
  7. ManagerJosh

    ManagerJosh Benevolent Dictator Staff Member

    what you want is:

    PHP:
    <?php 
     
    include "$page.html"
     
    ?>
     
  8. lance

    lance New Member

  9. ManagerJosh

    ManagerJosh Benevolent Dictator Staff Member

    Erm, Lance, my suggestion is that you do NOT infringe on the WorldSims name.
     
  10. Mirelly

    Mirelly Active Member

    I agree with Josh. Lance are you also behind simmedia.co.uk? What is the connection between the two?
     
  11. lance

    lance New Member

    Yep I have changed the name after that letter this morning.

    Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice