QUOTE(alex1985 @ Mar 11 2008, 05:01 AM)

Who know where I can obtain the tutorial "PHP and CSS"?! How to make PHP files like formating the site with CSS?!
Let's understand the connection between a few things here.
HTML is a "mark-up" language that is used on the Internet to provide information (web pages). In the form that it is intended to be used, according to the 'standards', the HTML of your pages should ONLY supply the content in a structured manner, meaning there is no 'styling' of the content based on the HTML.
CSS (Cascading Style Sheets) is what is used to 'style' the content of the HTML page. The CSS can be supplied in an external CSS file (preferred method), embedded in the head of the HTML page, as 'in-line' styling (not preferred, but it works), or as a default 'user style' in the User's Browser. There are rules about which of the styles apply to the content, basically, the closer to the 'content' the more important the rule. The User's style sheet can over-ride an Author's style.
Okay, now we have the content in the HTML and the styling in the CSS.
Where does javascript and PHP fit into this equation of supplying HTML and PHP? Simple.
Javascript is a coding language (yes) that works inside the user's Browser to do things 'local' to the machine. Example, get the time off the User's clock, but it can also affect the HTML and CSS, on the local machine. It can actually write to the html or css in the page if coded correctly.
PHP is a server side scripting language which can be used to supply the HTML (or CSS) to the Browser based on the GET or POST request, or based on the time of day AT THE SERVER, for example. PHP is used to provide a dynamic Web Site. It also is designed to do many other things, like red and write to files or databases, connect to remote servers to get information, etcetera.
You do not use PHP and CSS together. (sort of) You use php to write HTML and then the CSS styles the HTML output to the Browser. About all you can do with php, with respect to the styling, is provide the class or id's for the css to style. The styling can be written to an HTML page as it is presented from the Server to the Browser, or you can use PHP to select the CSS to be used in a Link tag based on a User's preference, but you do not use CSS with PHP without the HTML in-between them.
So the point of all this is to say that you do not 'format' the php using CSS, you 'format' the HTML using CSS. You use PHP to provide the HTML to the Browser.
[Notice how I avoided mentioning AJAX?]
Ajax uses javascript to interact with the server to provide updates to the web page (HTML) in an asynchronous fashion, without a page refresh, but don't worry about that until you are more aware of php and javascript and their coding uses. AJAX combines them to perform tasks.
I hope this helps explain the whole process a little better. Now, to answer your question...
You need to learn HTML and CSS so that you can make a web page and understand the 'structure' of the page (html) and the 'style' of the page (CSS) first. Then you can use PHP to write dynamic content into the web browser as Html, complete with the classes and named id's of the structure. Then the CSS acts upon (styles) the HTML (content).
Wow! that took a lot of thinking about, but I hope it assists you, and others, to understand the relationship between these factors that could affect your web designs. The most important first steps are to learn html and css.
Those two are the building blocks that your site is based on. Have a look though the Tutorials to see about learning html and css. Of course, there are some good php tutorials as well.
Reply