• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net

changing your entire site's layout through one file

Weapon

NLC
NLC
Is there some way I can change my sites entire layout through one file? eg. with ikonboard you can change you layout by going to board template which looks similar too

<html>
<head><title>Meow is freaky!!!</title></head>
<body>
sadghasgdasg
</body>
</html>

where sadghasgdasg is your content

but instead of changing just the site links colours and backgrounds, change the whole entire layout?
 
Yes that's possible.

You can use a standard php file as your template and dynamically include content in it. you just have to change the template and the whole thing changes.

Don't ask me how! I don't know how to code in PHP.
 
Hi! :)

What do you mean with layout? If it's only like text formatting, colors, sizes for boxes and such you can do it with Style Sheets.
 
Some example code:
PHP:
<html>
<head>
<title>BlabLA</title>
</head>
<body>
<table>
<tr>
<td>
Nav<br>
<a href="?">Main</a><br>
<a href="?help">Help</a><br>
</td><td>
<?php $inc="getenv("QUERY_STRING").php";
include($inc);
?>
</td></tr></table>
</body>
</html>
And you call pages like ?pagename
make sure you make a file named pagename.php in the same dir.
 
I used to use JavaScript, but now I use ASP which is ten times better. :) Doesn't really matter what language it's in. I think all the server languages support something to the effect of "include template.whatever". Whatever could be php, asp, cgi (?), etc.
 
ASP SUCKS!!! ;)

PHP is far better than ASP, most people will tell anyone. ASP is used in the business world because it is easier to find people that know Visual Basic over PHP or Perl. ASP loading times are slower if not equal to those of Perl

here, this is good enough:

Code:
<?php
  if ($section && $topic) include ("$section/$topic.inc");
  else if ($section && !$topic) include ("$section/index.inc");
  else include ("main.inc");
?>

that should make it a bit more organized.
if index.php is in the /www directory and someone clicks on a link that says index.php?section=test&topic=test, it will require a file in the /www/test directory and the file test.inc will be included. if it is just index.php?section=test, it will take /www/test/index.inc. if neither of the variables are set or if $topic is the only set variable, it will take /www/main.inc
 
Last edited:
My server's owner said that PHP and CGI take up too much bandwidth. :p Besides it loads fast enough for me and it does the job.
 
the admin's lying (obviously :rolleyes: ). if you have the same layout with PHP and ASP, it will take up the exact same amount of bandwidth. in the ASP file, its length will be longer, compared to the same layout in PHP.
 
Well I was reading over my first reply, and I think I may have led u to believe I meant something else. I meant that ASP was 10 times better than my previous JavaScript...not PHP. I have nothing against PHP. :)
 
Originally posted by clearjade
Well I was reading over my first reply, and I think I may have led u to believe I meant something else. I meant that ASP was 10 times better than my previous JavaScript...not PHP. I have nothing against PHP. :)

i know...i just hate Microshit so much :mad::mad::mad:
 
Meh, everything that I use is Microsoft, my email, my server, my system, even my instant messenger. *shrug* It works, and until other platforms or whatever become more easy to handle by the likes of ppl like me, Microsoft will be successful. That's life. No one has time to use the other stuff. It takes too long to learn. And please don't take something out of what I just said and use it against me. Ppl on here have a habit of doing that lol. I'm just saying that windows and junk is popular and easy to use in a short amount of time.
 
*sigh* plz answer my question and not argue ...... :D :D j/k anyways can some one tell me how to do it in css?
 
If you are referring to what I said it's basically a matter if skipping all formatting attributes in HTML and use CSS in a separate style sheet instead. No <font face= color= size>, no bgcolor, align and so on. You did it with the link colors. The thing is you can have 1 Style Sheet that formats your whole site. If you want to or instance change the colors you do it in one place and it works throughout the whole site. Very simple example below. You have to read the book on this one I'm afraid. :D

------------------------------------
<html>
<head>
<title></title>

<STYLE type="text/css">
<!--

body { background: #EEEEEE }

.weeps { font-family: "Comic Sand MS"; color: #FF0000; background: transparent none }

.meow { margin-left: 10%; margin-right: 15%; text-indent: 5em; line-height: 0.9em; font-family: Verdana, sans-serif; font-size: 1.2em; font-weight: bold; font-style: italic; color: #3333FF; background: transparent none }

-->
</STYLE>
</head>

<body>

<p class="weeps">
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
</p>
<p class="meow">
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah </p>

</body>
</html>
 
know of a good site that teaches these kind of stuff? and for the love of god stop calling me weep, weeps, weeper or other similar name!!! you are getting the whole forum to call me that, damn u meow!!!!!
 
Originally posted by Weapon
know of a good site that teaches these kind of stuff? and for the love of god stop calling me weep, weeps, weeper or other similar name!!! you are getting the whole forum to call me that, damn u meow!!!!!

Sorry Weeps. :D
 
know of a good site that teaches these kind of stuff?
Not one that has it all. www.htmlhelp.com has a good CSS1 reference. Dl the one in .hlp format. Then there are lots of "easy introductions". I'll check my links.
and for the love of god stop calling me weep, weeps, weeper or other similar name!!! you are getting the whole forum to call me that, damn u meow!!!!!
Yeah. It's catchy. :)
 
Back
Top