Search
Left Quote    If at first you don't succeed, redefine success.
- Anon.    
Right Quote
 
[login] | [Register]
Forum Index » Web Design » Viewing Topic and Replies
Post Reply


        Viewing Topic: Web Design Made Simple
  This user is offline  teachpower
  Subject: "Web Design Made Simple" Posted: @ 6:09 pm on Apr 11 2010   
Member #: 1228
Rank: User - (12)
Since: 04/05/10
Posts: 12
From: FL

I understand the basics behind the "Web Design Made Simple" tutorial. The only problem I have is trying to cut up the code I have now into header, footer, body, etc.

Now my question is how do I use this Echo variable in the header like the tutorial says to have a different page banner picture for each page?


Code:
<HTML> <HEAD> <TITLE> <? Echo("&quo t;); ?> </TITLE> </HEAD> <BODY>

<table width = "98%" border = "1" bordercolor = "#000000&q uot; cellspacing = "0" cellpadding = "2"&g t;



Thanks for the help in advance.



-TeachPower TeachPower.net founder Education Resource Library for the classroom & boardroom
    Viewed: 6,078 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Web Design Made Simple" Posted: @ 11:42 am on Apr 13 2010    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Echo is a function in PHP to to the screen. So if you wanted to display, "Hello World" to the user, it would be: <? echo("Hel lo World"; ?>

So your title can be the same way. You can make your title dynamic based on the page request. This can be done in 2 ways - construct the title from information you're displaying from the database, or use parts of the URL via $_SERVER['REQU EST_URI'].




-bs0d | AllSyntax.com

    Viewed: 6,063 Times | Reply to This | To top
  This user is offline  teachpower
  Subject: "re: Web Design Made Simple" Posted: @ 7:25 pm on Apr 19 2010    
Member #: 1228
Rank: User - (12)
Since: 04/05/10
Posts: 12
From: FL

bsod... First of all I apologize if I have these two different topics in different forums but I want to make sure I keep them separated for other forum users, even though both these challenges you have been helping me with are inter-related .

Anyways, another question I wanted to ask is do you think it would be wise to take each page and delete the content that is not the desired code I want then name that code section?
EX: Open index.htm in a webpage editor (I use FrontPage 2003) and delete everything that is part of the body and footer and then name it header.php? Then do the same for everything else (body.php, footer.php, etc.)?




-TeachPower TeachPower.net founder Education Resource Library for the classroom & boardroom

    Viewed: 6,029 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Web Design Made Simple" Posted: @ 4:10 pm on Apr 20 2010    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Yes. Take your website and break it into 3 common pieces for example: # Header # Sidebar # Footer
This is the code that is the same for every page. Then you create a file for your pages, and include the header, sidebar and footer.

So an example, index.php could be:
Code:


<?
include('../pa th/to/HEADER.ph p');
include('../pa th/to/SIDEBAR.p hp');

//content specific to index.php - bla bla bla

include('../pa th/to/FOOTER.ph p');
?>

This would be how all of your pages are. Then, when you make a change to any of the 3 files, it applies to all of your pages, and you don't have to make that change in every single file.

Also, you should work towards making your website dynamic, where the content is generated via database. Then, you have technically very few files of your website, but each file may be capable of generating an unlimited number of pages. For instance, I have one file that I created that will display an article from the database. I don't have a PHP/HTML file constructed for each one. The page just reads information passed to it to obtain the appropriate article and page.




-bs0d | AllSyntax.com

    Viewed: 6,021 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2017; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank