GNU   davin.50webs.com/webdesign
a GNU world order – your home of everything that is free

Main Menu Research Projects Photo Album Curriculum Vitae The Greatest Artists
Email Address Computer Games Web Design Java Training Wheels The Fly (A Story)
Political Activism Scruff the Cat My Life Story Smoking Cessation Other Links
Tutorial 1 Tutorial 2 Tutorial 3 Tutorial 4 Tutorial 5
Tutorial 6 Tutorial 7 Tutorial 8 Tutorial 9 Tutorial 10
Tutorial 11 Dec/Hex Codes H.T.M.L. ASCII Codes Using Emacs Download Links


Web design course tutorial 9 : sub-menus and CSS


Question 9.1: Unzip the archive file webdesign-tutorial-09.tar.gz using Winzip or the tar command for the purposes of completing this tutorial.


§ 9.1 Uploading your Website to Ripway.com


Question 9.2: Use the program FTP (Note that F.T.P. stands for File Transfer Protocol) to transfer all of the files in the folder tutorial-9 to your 50webs.com account. To do this you will need to follow the following steps:

  1. Open an MS-DOS command prompt
  2. Change directory to the tutorial-8 folder using the cd command.
  3. Start FTP by entering the command ftp ftphost.ripway.com.
  4. Enter your Ripway user name and password that you created in the last tutorial.
  5. Enable "Binary Transfer Mode" using the command binary (or bin for short). Binary transfer mode is essential for images to be transmitted successfully.
  6. Turn "Interactive Mode" to off using the command prompt (or prom for short).
  7. Transfer all files using the command mput *
  8. Wait for the files to be transmitted.
  9. Leave the FTP program running so you can upload files at a later time.
  10. Load your Website into a Web browser to make sure your Website has been transfered successfully.

When you have finished doing this, you should browse your 50webs.com Website to verify that all files (P.H.P. and image) have been uploaded successfully.


Question 9.3: Then check that the sub-menus of the page inner work propertly.


Question 9.4: Change the variable $logo in the file tutorial-9/index.inc to something more appropriate to your Website. Also change the file tutorial-9/index.php so that it says: Welcome to Your Name's Website! and displays an image that is more appropriate to your Website.


§ 9.2 Sub-menus and sub-sub-menus

§ 9.2.1 How to create sub-menus of a given page

  1. Let the file of the page that you want to create sub-menus of be denoted by X.php.
  2. Let the title of the page that you want to create sub-menus of be denoted by TITLEX.
  3. Let M.inc denote the menu page of X.php.
  4. Let COLOR denote the colour of the sub menus inside the page X.php in the form #RRGGBB, for example #ff8844. It is cosmetically important that the colours of your sub-menus differ from the colours of all other menus in your Website.
  5. Suppose you want to create N sub-menus in the page X.php.
  6. Suppose the sub-menu files are FILE1,FILE2,FILE3, . . .  ,FILEN. Note that the files will be prefixed with X- so that you know that they are sub-pages of X.php.
  7. Suppose the sub-menu titles are TITLE1,TITLE2,TITLE3, . . .  ,TITLEN.
  8. Create a file X.inc containing the following:
    <?php
    
    include "M.inc";
    
    $button_col_bglo = "COLOR";
    
    for each sub-menu I in the set 1,2,3,...,N add a line that says: button("X-FILEI.php","TITLEI");
    
    $back_to = "<a href=X.php>Back to TITLEX Page</a>";
    
    ?>
        
  9. For each I in the set 1,2,3,...,N Create a page X-FILEI.php containing the following:
    <?php
    
    $file = "X-FILEI.php";
    $title = "TITLEI";
    include "X.inc";
    include "root-second.inc";
    
    ?>
    
    Your text for each page goes here
    
    <?php
    include "root-last.inc";
    ?>
    
        
  10. Change the first include in X.php to: include "X.inc";
  11. Let the parent title of the page that you want to create sub-menus of be denoted by TITLEP.
  12. Change the $backto setting near the bottom of X.php to: $backto = "<a href=M.php>Back to TITLEP</a>";


Question 9.5: Add sub-menus apple-1.php, apple-2.php and apple-3.php to the page apple.php. Upload your changes using the command mput *.php *.inc and use a Web browser to check that the sub-menus have been added successfully.


Question 9.6: Add sub-menus apple-1-1.php, apple-1-2.php and apple-1-3.php to the page apple-1.php. Upload your changes using the FTP command mput *.php *.inc and use a Web browser to check that the sub-menus have been added successfully.


§ 9.2.2 How to delete sub-menus of a given page

  1. Let the file of the page that you want to delete sub-menus from be denoted by X.php.
  2. Suppose there are N sub-menus of the page X.php.
  3. Suppose the sub-menu files are FILE1,FILE2,FILE3, . . .  ,FILEN.
  4. Delete the file X.inc. This will delete the menu buttons for the sub-pages that you want to delete.
  5. Delete the files X-FILEI.php for each I in the set 1,2,3,...,N. This will delete the sub-pages from your Website.
  6. Delete the $backto= command in X.php.
  7. Change the first include in X.php from X.inc to the value at the top of X.inc.


Question 9.7: Delete sub-menus inner-1.php, inner-2.php and inner-3.php from the page inner.php. Upload your changes using the FTP commands mdelete *.php *.inc and mput *.php *.inc and use a Web browser to check that the sub-menus has been deleted successfully.


Question 9.8: After you have answered the previous question and verified that it did delete the sub-menus, delete the page inner.php. Go back to Section § 8.5.4 if you cannot remember how to do this. Upload your changes using the FTP commands mdelete inner.php and mput inner.* and use a Web browser to check that the page has been deleted successfully.


Question 9.9: Swap the following variables at the top of the files *.inc:

Save the files that you have edited and upload your changes to Ripway using the FTP command mput *.inc. View your Website in a Web browser and verify that the background and foreground colours of all of the menu buttons have been reversed.


§ 9.3 How to answer the following questions

Every file that you edit will need to be transmitted using the program FTP before you can load your Website into a Web browser. For example, if you edit stylesheet.css and index.php, then you will need to issue the command: mput stylesheet.css index.php.
Back to Web Design Course
This page has the following hit count:
| Main Menu | Research Projects | Photo Album | Curriculum Vitae | The Greatest Artists |
| Email Address | Computer Games | Web Design | Java Training Wheels | The Fly (A Story) |
| Political Activism | Scruff the Cat | My Life Story | Smoking Cessation | Other Links |
| Tutorial 1 | Tutorial 2 | Tutorial 3 | Tutorial 4 | Tutorial 5 |
| Tutorial 6 | Tutorial 7 | Tutorial 8 | Tutorial 9 | Tutorial 10 |
| Tutorial 11 | Dec/Hex Codes | H.T.M.L. ASCII Codes | Using Emacs | Download Links
Last modified: Sat 20 Aug 2022 16:54:12 NZST
Best viewed at 1024x768 or above resolution.
© Copyright 1998-2022 Davin Pearson.
Please report any broken links to