...

View Full Version : Mixing design with php files



wiseguy89
04-23-2008, 07:40 AM
Hey Y'all,

If I wanted to design a web page, do you prefer creating a separate CSS file or making like a header.php or footer.php file?

FWDrew
04-23-2008, 07:51 AM
Hey Y'all,

If I wanted to design a web page, do you prefer creating a separate CSS file or making like a header.php or footer.php file?

Yes.

The question is confusing. An external CSS file is pretty much a must and will contain all the styling and display aspects of the page.

PHP is a server side programming language. The include() function in PHP would be helpful and is used quite often for things like the header and footer.

It might help to research a little into CSS and PHP so you can see the difference between the two and how to use them to enhance your web page :thumbsup:

Drew

wiseguy89
04-23-2008, 07:57 AM
okay so one CSS file can layout the entire page? how would you know where to insert the php files in the design?

Arnaud
04-23-2008, 10:45 AM
One CSS can layout your whole website or parts of it - this depends on what you want to achieve.

Where to insert the PHP files?
- What is your PHP code doing? If your code should display something to the visitor, then place it in your HTML code at the place where you want the PHP output to be displayed, separating it from your HTML code using <? ... ?>

Otherwise, your PHP code can simply be placed at the top of your pages, or anywhere else. Code is always executed from top to bottom...

You should check a few basic tutorials on how to combine HTML, CSS and PHP together.

idalatob
04-23-2008, 11:05 AM
honestly... cant people look through a couple of tutorials before asking tedious & pointless questions?

That was rhetorical, and no offence intended.

CSS-> contains style elements.
Include-> contains something generic about your website.

Normally an include would contain PHP code, but in this case we'd make it just plain HTML.
SO, if you want a line at the top of your website:
<hr> -> that would be in a file called header.php.

Now you want two lines: so you do this->
<hr><hr>

Now the changes will be generic, that is wherever you included the file: ie->

<?php include("header.php"); ?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum