![]() |
![]() |
![]() |
![]() |
![]() |
||||||||||||||||||||||||
![]() |
![]() |
![]() |
shinichi♥stranger carol♥z-motion aquila♥(inky);paper map♥swordmanspirit |
![]() |
||||||||||||||||||||||||
![]() |
![]() |
![]() |
![]() |
|||||||||||||||||||||||||
PHP tutorials: IncludeLevel:
The include-function is the most easiest way to get into PHP if you haven't had some experience with it yet. This turorial will give you a short but effective introduction by explaining how to get your table layout run with PHP.Today's schedule is to code a four area table layout which conforms to the content (major text and sub-pages). In short: If you activate a link at the navigation/ menue the table will conform to the content and the table pulls under. Best example is Grieved-Lightness - you need to scroll all way to down to read the last sentence. ![]() 1. Create a html-document and an ordinary tableFirst of all you have to create a new HTML-document and a table within that consist of three raws and two column as pictured on the example. If you do so your table should look similar to this one:<table width="60%" border="0">The code <td colspan="2"> means that two colums became one and you got one column instead of two. In this example this happened to the header and footer colums. This way you get more space for text and images without need to cut them. Codes which look like <!--BLA--> are simple annotation and don't have any influence with the final result. 2. Seperate codeFor the include-funktion we need to cut the layout into three pieces: header (red code), content (yellow code) and footer (blue code). Make sure to save these pieces as header.php, index.php and footer.php. The basic idea is to build a (table) frame around your contents. You can tell that from just looking at the code above. To do it right you need to save the everthing that's in front of your content as header.php and everything that follows as footer.php. If you do so your PHP-documents should look like this:header.php: index.php: footer.php: 3. the unbelievable-amazing-and-allmighty Include-functionLet's leave it at that and let's have a closer look at the index.php which now contents your contens (a very confusing sentence :|). Your layout is now seperated into three pieces but they won't work like this together. You still need to INCLUDE your content between header and footer:index.php: Did I promise too much? I guess not since the include-funtion is as easy as useful. Do this with all of your sub-pages and you don't need to be afraid of too long text anymore :) Remember to address the sub-page directly if you want to link to a specific one and leave the target blank. Just type <a href="index.php">index</a> and do not link to header.php or footer.php since those pages will just be displayed relating to sub-pages which are included between them. last updated on February 4, 2010
⬅ GO BACK
|
|
|||||||||||||||||||||||||||
![]() | ||||||||||||||||||||||||||||