Header and footer codes?

Discussion in 'Web Design' started by kiko_friendly, Mar 10, 2007.

to remove all ads.
  1. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    the file extension is more or less irrelevant. inc, txt, htm - makes no difference.

    your indexes.shtm won't work because it's an incomplete file. your first tag is a body tag. the browser is therefor recognizing it as a plain text file and displaying it's contents as such.

    are you using dreamweaver or a plain text editor to do your coding?

    anyways, try adding the following to the beginning of your indexes file...

    Code:
    <html>
    <head>
    <title>Your Pages Title goes here!</title>
    </head>
    hope that solves your problem.
     
  2. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    also, looking at your include files, i got a few pointers for you.

    1. don't include any head, title, html or meta tags in your includes. included files should only include content that belongs between your body tags. when they are included into your main file, they will become one with it and thus any such tags would be redundant and can cause problems.

    2. i suggest putting all of your css styles into a separate file and include it into the page. makes for much cleaner code and again, keeps you from having redundant code which can cause problems. css would be included just under your </head> tag.

    those are the two main things i noticed while just glancing over your top.inc file.

    i'll see if i can't get a very basic example up for ya. it might help up clear up some things when you see it. :)
     
  3. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    Okie doke. I will do that. I know how to do the link rel stylesheet thingamie, so that's AOK!
     
  4. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    Still not having much luck. :( I dunno what to do!

    I will message you like you said, though.
     
    Last edited: Mar 21, 2007
  5. Recoil

    Recoil New Member

    Messages:
    5
    hi there,

    php includes are fairly easy (if i remember the syntax correctly)

    <?php include("filename.html"); ?>

    put that line of code in your main page wherever you want.

    The only thing with php includes is that you will need to rename any page that uses them from a .html to .php
    (the included pages can be still be .html provided it doesn't use any other php)

    i hope this helps (and makes sense)

    :)
     
  6. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    Yeah but when I try to open my file it just opens dreamweaver!
     
  7. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
  8. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    Do I need to install PHP?
     
  9. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    php appears to be installed on the server, but URL file-access is disabled appears to disabled, thus, includes won't work in php. i wonder if your problem all along has been that SSI is disables on the server as well.

    might be time to have a little chat with your host. ;)
     
  10. Recoil

    Recoil New Member

    Messages:
    5
    Yes, you will need a host that has PHP installed i'm afraid.
    The file willnot open on your computer unless you have PHP installed (hence why it is opening in dreamweaver - as that is the associated program for PHP files on your PC)
     
  11. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    *stabs uninstalled PHP*

    Okay, could ya link me to somewhere that can help me install PHP on my site?
     
  12. Recoil

    Recoil New Member

    Messages:
    5
  13. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    It's installed. I just need to put the files in the cgi-bin folder instead of www

    o_O

    Did you know that?

    I didn't! Haha.

    Oh well. I will experiment later.

    Also, do I need to install PHP on my PC?
     
  14. Recoil

    Recoil New Member

    Messages:
    5
    you would only need to install PHP on your PC if you want to develop and view your files locally.
    otherwise if you wanted to view any php files you would need to upload them to your server
     
  15. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    in order to view them locally you would need to setup a web server (either IIS which comes with XP Pro and XP MCE or apache) first. then install php. php files as default should be viewable anywhere within the site. they should not be limited to your cgi-bin folder.

    i didn't know you had your own server. i figured you were on shared hosting like the majority of us.
     
  16. Recoil

    Recoil New Member

    Messages:
    5
    Yes, quite correct... i forgot that bit! :eek:
     
  17. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
    I'm on a shared server, though...
     
  18. kiko_friendly

    kiko_friendly New Member

    Messages:
    305
  19. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    i get an internal server error. i quote: "Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error."

    as i suggest in an earlier post, contact your host, as their obviously is something wrong. either make sure they have SSI enabled (shtml) or that php is installed and properly configured.

    but again, php should not be limited to your cgi-bin.

    404 page not found...
     
  20. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    sorry, from your post above i was under the impression that you installed php on your server personally. in a shared hosting environment you do not have full admin access and can not install software on the physical server.
     

Share This Page