+ Reply to Thread
Results 1 to 7 of 7

Thread: I need a little help.

  1. #1
    jakeselectronics is offline x10Hosting Member jakeselectronics is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    38

    Question I need a little help.

    Hey everyone,

    I have built a website and it has come to that time again where I need to expand my knowledge.

    A bit of background....
    I have writen my code in notepad for everypage, I haven't used a webpage dev program.
    Every page is a .html.
    So every page contains the layout (heading, menu, links..), plus the content of that individual page...

    Everytime I add a new page I copy an existing one and and simply edit the content section.
    If I want toi add a new link to the menu bar, I have to go to every page on my site and add it in manually.

    As my page gets more and more content this is getting more and more tedious to add things.

    I know there is a better way to build web pages... But I dont know where to start or look.

    Here is my page for anyone that is interested.... http://www.jakeselectronics.x10hosting.com

    Can anyone guide me to tutorials/give advice on how to better develope my website.
    I know I could ask a Web deisgner, But i dont the funds, plus I want to learn how to do it...

    Thanks,
    Jake.

  2. #2
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: I need a little help.

    this is exactly why I use PHP.

    the include() function is the best thing. just make one page that has your navigation, and include it in your template, when any page is called the navigation is called from that one page, and it will be updated on all pages...kinda confusing

  3. #3
    jakeselectronics is offline x10Hosting Member jakeselectronics is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    38

    Re: I need a little help.

    the principle isn't confusing. It makes good sense.

    But I am confused how to go about it.

    Got any good links to walk me through how it is done?

  4. #4
    Sarnuial is offline x10Hosting Member Sarnuial is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    6

    Re: I need a little help.

    Here we go, PHP in five minutes.

    To indicate the start and end of a block of PHP code, you've got to use PHP's start and end tags, like this:
    PHP Code:
    <?php

    ?>
    In between those, you can use PHP functions. For example, the include function:
    PHP Code:
    <?php

    include();

    ?>
    Note the semicolon at the end of the line. All PHP instructions must end with a semicolon to signify to the interpreter that the command is finished.

    Functions in most language take what are called "arguments". These are bits of information passed to the function that tells the function what to do or changes the way it does something. In PHP, these arguments are comma-delineated and placed in parentheses after the function name. If no arguments are to be given to the function, the parentheses must still be present, but should be empty. In the case of the include function, we need to pass the name of the file to include:
    PHP Code:
    <?php

    include('file.inc');

    ?>
    That will cause PHP to try to include the file file.inc (where "inc" is an abbreviation of "include") from the same folder as the script into the current output.

    Note the single quotation marks around file.inc. These tell PHP that file.inc is a "string" - a set of characters that all go together. You can also use double quotation marks; there's a few differences, but that's beyond the scope of this post.

    So, there you go, a crash course in PHP. To use any PHP, you'll have to rename your files to .php instead of .html; that way, the x10Hosting webserver will know that you want to parse the files with PHP. For further reading, check out the PHP tutorial at W3Schools.

    Have fun!

    --- Sarnuial
    Last edited by Sarnuial; 10-16-2009 at 08:58 PM.

  5. #5
    jakeselectronics is offline x10Hosting Member jakeselectronics is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    38

    Re: I need a little help.

    Ok thanks.
    I am about to have a go at changing some of my pages (then the whole site) over to php using includes.

    Just another question before I do.

    Say I have multiple pages that use an include for the header, links bar, menu and footer.....
    Should the include file include table information such as sizes etc...
    Or should the include file only include content, Therefore each individual page has contains the table information, then it calls the include file just for the content...

    ??
    Bit confussing, please let me know if you cant understand what i am asking and ill re-phrase it...
    Last edited by jakeselectronics; 10-16-2009 at 09:09 PM.

  6. #6
    Sarnuial is offline x10Hosting Member Sarnuial is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    6

    Re: I need a little help.

    I understand what you're asking. Really, it's up to you: go with whatever you think will be easiest to maintain in the long run based on how your HTML is laid out. My big suggestion, though, would be to forget about tables entirely and look into CSS-based layouts.

    --- Sarnuial

  7. #7
    playminigames is offline x10 Sophmore playminigames is an unknown quantity at this point
    Join Date
    Jul 2009
    Location
    earth
    Posts
    216

    Re: I need a little help.

    also dont forget to rename all of your pages from .html to .php for them to work.

    Good Luck!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers