Site Logo  

Welcome to the
Build It Yourself Website .com

 
Under Construction
Note: This site is currently under construction.
 
 
Menu



Get your free Build It Yourself Website .com Template.

Right click and choose "Save Target As..."

Right Click - Save Target As...




Additional Information









 

Lower Right

Lower LeftWhen opening up the code for the lower right portion of the website notice that it looks exactly the same as the code for the lower left portion of the site. Because the codes look exactly the same, we are not going to be going over what it says. Instead, let's look at what else you can do with this area.

Just like with the lower left portion, if you don't want anything in these corners, delete all of the code and just have empty spaces. There is nothing wrong with this. Just because there is space, does not mean it has to be jammed full of stuff.

But let's say, for the sake of this lesson that the code on the right lower corner should do the same thing that the code on the lower left corner of the site is doing. Currently, if a change is made to one side, the same change would have to be made to the other side making double the work.

What could be done instead is to use a small php script to include the code of the lower left into the code of the lower right automatically. That way, when you update the lower left corner, the lower right will automatically be updated. Sound good? Though so.

Ok, go ahead and open up the "lowerright.inc.php" file in HomeSite. It is in the "includes" folder of the website.

Delete every single line of code in this file. Yes, that's right, get rid of all of it.

Then add this line of code:

<?php include ("includes/lowerleft.inc.php"); ?>

That's it. Now, when a change is made to the lower left corner of the website, the change will automatically occur in the lower right corner as well.

How does this work? Well, it is actually very simple. Let's look at the code and what it does..

The first portion is "<?php" . This tells the computer to start a php tag (which is one of the reasons we save all of our files in php instead of html).

The next word "include" tells the computer you want to include another file from somewhere. The "("includes/lowerleft.inc.php")" tells the computer where to find that file. Notice that the path to the files is written as if it were from a main webpage and not from the "lowerright.inc.php" file location. This is because this is also an included file that is being included into a main webpage. The semicolon ";" is needed to end the "include" tag and the "?>" completes the php script.

Fairly easy isn't it. Ok, go ahead and save the file and upload it to the web server. As you can see, the left and the right will both show the same script with different randomizations.

Congratulations!

    



 
 

Google



Additional Links    •    Search    •    Contact Us    •    Site Map



Any problems with this site, please feel free to contact the webmaster.

 



By viewing this site, you agree to the
Terms of Use Policy.

Copyright © 2002-2011 Build It Yourself Website .com