Forum Moderators: coopster
I was browsing your forums and noticed your post on making a dynamic site in 2 mins, that helped me out greatly as I am new to this. Thanks, But I was wondering If I could ask you a question.How do I create a website which has the navigation bars etc down the sides rather than at the top, I just wanted a logo on the header file and maybe some info down the right. Would I use frames?
My Answer: Don't use frames. Lay out your page in html using tables. Now highlight and cut everything BEFORE the unique content and create a new file called header.php and highlingt everything AFTER your unique content and call that footer.php.
I will remain netral on your recommendation of <div> tags, but I think this person should learn one thing at a time, and therefore, use what is familiar first. If tables is more familiar, use tables. If div is more familiar, use div. The main thing right now is they need to lay out the page and then split it into the three sections:
header, content and footer.
My Answer: Don't use frames. Lay out your page in html using tables. Now highlight and cut everything BEFORE the unique content and create a new file called header.php and highlingt everything AFTER your unique content and call that footer.php.
Good advice for them. However, I don't think using all those files is a good idea - it is unnecessary when you can have it just all in one. You can do it simply with echoing variables.
Example (with heredoc syntax):
$header = <<<END
header html here
END;
$footer = <<<END
footer html here
END;
and then in the page just include that file and use
<?php echo $variablename;?>
or you can use the shorthand for echoing
<?=$variable?>