Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
First of all, I'm not asking anyone to catch me a fish, but just to teach me how to fish.
I'm very noob when it comes to web design as you can probably tell by my website dirtjournal.com. I put it together with notepad a few days ago and I've pretty much exhausted my very limited html knowledge.
If you look at the site, you can probably predict that I'm going to ask you how to build the same thing without frames. The main reason I want to ditch them is because everything auto resizes as the browser window is resized. This looks hideous to me, but I have no idea how to build an html site that doesn't resize with the broswer window...like this site for instance.
Originally, I used frames so I wouldn't have to reload the entire page every time a link was clicked, but it doesn't seem like there is anyway around it.
Much appreciate any help you send my way.

bazooka,
I don't have the time to check out your page, but I'm sure it looks great! Starting off with limited knowledge is the only way all of us got started, so don't feel bad. As far as getting rid of frames, I would completely agree that they are a bad thing. Use tables instead. The "table", "tr", and "td" tags will save your life. As far as being able to keep from having to re-code every time you make a new page, you can try using some primitive PHP or ASP or you could try SSI (server side includes). SSI is probably the easiest way and I'd be surprised if your host doesn't allow it. Just Google for "SSI #include" and you'll probably find more than enough info. It will allow you to create bits and pieces of HTML and then put them all together into a page. For instance, you could put a side menu into a seperate HTML file and then include it in all your pages. Then, updating the single HTML file will change all the other pages instead of having to redo every one.
I wish I had more time, but I don't. Let us know if you can get anywhere on this stuff and I'll try to keep up with your post.
Good luck and happy programming.
Stephen"Live long and PROGRAM......or at least do _something_ with all that time...!"

Stephen, thanks for the fast reply!
I thought about using a table, but I notice that they resize the contents (text) as well which is the main reason I want to use something else (although probably not the most important reason).
I read a quick tutorial on using php includes shortly after I made this post and it looks like something I can use. That solves my "redundant page" problem at least. Now if I can figure out how to "solidify" the page instead of having a bunch of stuff moving around when the browser window is resized.
Thanks for the input, and I'm looking foward to more.

bazooka,
Just specify the size you want the table to be and it will not change. For instance,
<table width="100px">
Would make the table 100 pixels wide and never change. You don't need the "px", but it helps for clarity and might not be a bad idea, though numeric values for sizes usually always default to pixels when not specified. I use this all the time, though there may be some who would rather you use CSS to control the width of your elements. I would agree it might be a good idea to get around to using CSS to control all elements, but it would be a hassle. To get you going, I'd just use the "width" argument to the <table> tag.
Remember, there is also a "width" argument for the <td> tag as well. If you take a look at the HTML to this forum (which you have mentioned before), you'll see a table with width 756 and a first column set to 115. You'll then see another column set to 1 (I think it's the little spacer between the side menu and the main body) and then another column (the one this message is in) set to 479. In my observations (I've dealt with this a lot), almost every page that has good layout uses tables. Perhaps somebody else could shed some light on another way, but tables work great for me and many others who are much more professional than I am.
Good to hear about the PHP. A little server side programming goes a long way!Stephen
"Live long and PROGRAM......or at least do _something_ with all that time...!"

Ahhh, that saves the day man. I greatly appreciate your help. I wish all those html table tutorials would have mentioned this!
I also read up on SSI last night and decided to try it out to see if I can get it to work like I want.
Stephen, your the man! Hope you get time to check out my page, before/after. I'll be working on it today.

Well, I've got the entire site transferred to a table, everything staying in one place, and it looks 100x better. THANKS!!
Now I'm trying to get this simple PHP include script to work...but it's not. Can someone see what I'm doing wrong? I've made these very simple test files...they open individually just fine, but I can't get the menu.html to be included with the PHPTest.html...
PHPTest.html...
<html>
<body bgcolor="#E8E8E8">
<?php require("menu.html"); ?>
</body>
</html>
menu.html<html>
<body bgcolor="#A0A0A0" link="#000093" vlink="#00004A">Hello.</p>
</body>
</html>And I have them both loaded onto the root directory of the server (http://dirtjournal.com/menu.html and http://dirtjournal.com/PHPTest.html) but they don't seem to be working. I know the server has php because I'm running phpBB. Am I missing something?

bazooka,
OK, couple of things. First, AWESOME site man! That thing is pretty sweet and it sounds like you have a lot of fun. I'm ready to go pick up a DFX myself and have at! Really, the design and color scheme is one of the best I've ever seen.
Second, the test files are doing what they're supposed to, I think. You've obviously changed them around since your last post, but not much. Try renaming anything with PHP in it to a .php file rather than a .html file. Most web servers won't process PHP commands in a file if it's not a .php extension.I would also personally use the include rather than require function. I would also break up the PHP lines onto seperate lines to promote clarity. Something like this might be clearer and can clear up some problems if the above doesn't work.
<?php
include("whatever.php");
?>
Another thing is, don't put <html> or <body> tags into the included file. It can cause some browsers to render your content badly.
I like your use of "check 1" and "check 2". If I'm not mistaken, you were trying to isolate to see if the PHP parser stopped working between the two. If so (or even if not), that is an _extremely_ smart and effective way to discover many syntax problems. (if the parser encounters gibberish, sometimes it will stop on the line in question and go no further). I usually use just 1,2,3, etc. but that's just for speed.Another trick you may already know is to go to the PHP page in your browser while it's on the server and then view the source of the page. You won't see the PHP--instead, you'll see the generated HTML output. If you do this with the PHPTest.html you'll still see the require statement isn't processed. I believe that's because it's still a .html file. It has to do with the MIME extensions associated with the PHP parser on the web server. Basically, just try renaming the file to a .php file and see if that works.
I'll be waiting to hear if that works or not.
Stephen
"Live long and PROGRAM......or at least do _something_ with all that time...!"

The site is looking good. The only thing I would suggest at this point is to use a little more cell paddding on the table cells. The text is kinda close to the borders.

Stephen, I completely forgot that someone may actually look at the files so I was playing around with them to see if I could get them to work on my own. As you suspected, I was trying to isolate the problem by using the paragraphs on either side of the script to see exactly what was happening...if it was stopping between or if it actually ran the whole thing. Who would have thought that I just needed to change the extension. I'll give it a whirl and see what happens.
Randy, Much thanks for the input. The menu on the left is temporary. I plan on using a menu with jpg buttons so it will just be one big block. However, now that I look at my archive table, I do agree that it needs some more room. I'll bump up the padding once I get this include to work. So far I've had to go through all 12 files copying and pasting every little change I want to make...then by the time I get done, I find something else I need to change. I can't wait to get this php working so I'll only have to make one change!
I'll keep you guys updated on my progress. Thanks again for the help!

Getting closer! The pages in my root folder are working great. All 4 includes work on these pages.
However, I have one, probably simple problem. I keep my archive pages in an "archive" subfolder. Of course, the script can't find the menu.php, footer.php etc. in the archive folder. So I tried...
<?php
include("../menu.php");
?>etc.. on december.php. But it still isn't finding any of the includes. How do I direct the script to the correct folder?
Thanks in advance!

bazooka,
I think you should just be able to use:
include("/menu.php");
The leading forward slash should reference to the root on the web server. Let us know if it works.
Stephen
"Live long and PROGRAM......or at least do _something_ with all that time...!"

Unfortunatley, that didn't work. I left the faulty php's in the /archives folder if you want to take a look.
http://dirtjournal.com/archives/december05.php etc...
It's not a big deal and I can live with it if I have to, but I just wanted to keep the archive files "out of the way".
Thanks again for the help. What do you think about the updated titlebar?

bazooka,
Sorry man, should have caught it earlier. Try:
<?php
include "../menu.php";
?>Include is a statement, not a function, and as such does not use () to enclose the argument.
As for the title bar, I think it looks different, but I can't tell exactly what. It's been late/rushed when I look at the site, but I think everything still looks great! I'll take a stab in the dark and say you added the shadow, which I like (don't be offended if it was already there, it's just what sticks out most to me right now).
Keep it up man, these PHP problems can be pesky, but they're worth fixing because of the power it can give you. Let us know if you've got any other problems.Stephen
"Live long and PROGRAM......or at least do _something_ with all that time...!"

![]() |
Apache Under XP
|
php help needed
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |