hi first im i am a new member here i just registred but i hope to get some help, i hope my english is understandable and readable :).
i want to make a clean php website with out any html… i have tried to search the internet and i havent being able to find the resolved part for my issue ,
i have a folder called css. and a file there called style.css how to i get my index.php to load it so the color and stuff is viewable ?
i tried include (‘css/style.css’); @import any mant other stuff yes i have installed php5 and php pear if that got some thing to do with i have my own server at home so if i need some thing else installed let me know i am also new at this php i am starting from scratch i am how ever some years ago used to play abit with php .
i hope some will be kind to help me resolve my problem thanks alot in advance , i hope that i posted this the right place here …
Well you have the idea of PHP a little backward. PHP is server side, there still must be a client side language that tells the browser what to display. Think of PHP as the prep work for HTML. You COULD do something like this, but its just silly…
As guido2004 says you need html otherwise you will just have an empty page.
Have you viewed the source of a php page?
A definition of css:
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL.
Again, this is part of HTML / CSS, not PHP (or any other server side language)
Example of when to use PHP: I need to access a database, do number / string comparisons and manipulations, determine what color to make the background based on a user preference.
When to use HTML / CSS: Display text, color and images to the user.
Here’s an example of your background question, I’ll display a random text color for a sentence in a web page.
Now what this script does is picks a random number between 1 and 0, and if 1 (true) it will print blue, else it will print red. When the web page is opened up and you view source (right click in a page and view page source) you will only see the html portion:
<html>
<body>
<p style="color: #FF0000">This sentence is red</p>
</body>
</html>
The end user will never be able to view server side code, it is executed before being sent in the form of HTML. It is the CSS property of “color” that defines the text color. Does this clear some things up?
i also happend to have a nother question i have a created a mysql database how to i do so it can load my css ? i want to learn basic things i guess i know i can read i just think its more interresting asking people who know about this
Alright then. Why is it you thnk you need to load your css files to a db? This is not a common practice at all. What is common practice is using a db to store user credentials, page content (this allows you to develop a single html / php file and then retrieve the page content from a db. What functionaility would you like to try to create for your first project? User login? Poll? Content Management System?