sabato 20 agosto 2011

HTML / CSS – What Do We Do Now (Conclusion)

html conclusion HTML / CSS What Do We Do Now (Conclusion)




It’s always the same. You see the summary of the tutorial for the first time, look at the list of chapters, and say to yourself : What ?! You need to learn ALL that to make a web site ??
And nonetheless you read the chapters one by one and… you eventually reach a page called Conclusion.


You ask yourself the question Have I learnt everything ? or What shall I do now ?.


I think the first thing we need to do is a summary. That’s to say, a conclusion of everything we’ve seen now that everything’s finished.


At the same time, this will be the occasion to find some things that we haven’t seen.
Why ?
What’s the point ?
How to find out more ?


So many questions that I’ll try to find answers for icon wink HTML / CSS What Do We Do Now (Conclusion)


You must remember that the lessons were separated into 3 parts :


Part I : XHTML tags : After a brief introduction about the tools that are used (Notepad, Notepad++) and the browsers (Internet Explorer, Firefox, Opera…), we started making our first pages entirely in XHTML.
We learnt the basic structure of an XHTML page, how to write text, how to make links, and finally how to insert images.



In this part I voluntarily avoided talking about CSS. Okay, the pages we made were extremely ugly, but that allowed us to learn one language at a time to start off.


Part II : It looks nicer with CSS ! : After a certain amount of time, I had to start talking about CSS. As soon as I thought you had enough knowledge of XHTML, we started on CSS. The chapters were quite long, I admit, and it was quite challenging. In effect, once the basics of CSS were learnt, we simply had to… learn the loads and loads of CSS properties.



I did my best to stop the chapters from being too repetitive, but CSS is made like that, I didn’t invent anything.


Part III : XHTML & CSS – Always Stronger ! : After that we went to the next level. In this part, XHTML & CSS worked side by side, and the least we can say is that you had to pay close attention. Right, the first chapter on lists was an easy introduction so that you could see how the two languages worked together. But then came the chapters on blocks, positioning in CSS… the hardest part of the lessons. It was delicate but indispensable to be able to create a proper design.

design HTML / CSS What Do We Do Now (Conclusion)


After having seen how tables are made, we finally stopped with forms. A chapter which, as you’ll have guessed, wasn’t placed at the end for nothing. In effect, it was a frustrating chapter because we could only create forms without being able to process the data.


And I promised to say a bit more about PHP, this famous language that’ll allow us to retrieve the information from forms. We’ll talk about that a bit further on.

Are there any XHTML tags and CSS properties that we haven’t seen ?


The answer is of course… yes.
Let’s see them now.


First of all, let me clarify things : if there are elements that I haven’t talked about, it’s mainly because they didn’t enter into any of the themes of the chapters. And as I prefered not to make a scrappy chapter name Other Tags, I avoided the subject.
However, because of my honesty, I’ll still tell you about the things we haven’t seen icon smile HTML / CSS What Do We Do Now (Conclusion)


So there are tags you don’t know. Will that penalise you ?
Not really. For example we didn’t talk about the



tag. It’s a tag that creates separation lines on a page. You can explain it in one sentence, so it’s difficult to create a chapter about it icon wink HTML / CSS What Do We Do Now (Conclusion)

So, how can I get the list of XHTML tags that exist to complete my knowledge ?


Simply go to the chapter List Of XHTML Tags in this tutorial.
There really aren’t a lot of tags that we haven’t seen. Because of this, I suggest that you make sure that you understand everything we HAVE SEEN before rushing off to see the other tags.


With CSS, things are a bit different. There are a lot of properties, and I made the effort, as I promised, to make sure you saw the majority of them.
However there are some I didn’t talk about. Mainly, it’s because they’re used in specific cases : there are some for example that are used to show the pronunciation, others to give instructions to printers etc…
And I simply left some to one side to keep things simple enough to understand.


But once again, if you want to know everything, I invite you to read the chapter List Of CSS Properties.


Also in CSS, you must know that there are a lot of tricks that are used for precise effects. These tricks weren’t seen in the lessons either because they’re used in specific cases.
Some allow you to create nice menus, others correct bugs in Internet Explorer etc…


I said I would talk about PHP, the moment has finally arrived.
More generally, we’re going to see if there are any other languages that you can learn in relation to XHTML and CSS.


These languages can be split into 2 categories :


client based languages : languages that are launched on the visitor’s computer. In which case it’s the computer that does the necessary things to obtain the desired effects. Among the client based languages, the best known one is JavaScript, which you have probably heard about as it is very popular.


server based languages : this is more serious. These languages are launched on machines called servers. They’re a sort of huge computer that you’ll never have seen and whose sole job… is to distribute your web site to visitors.


Server based languages are more complicated, but also a lot more powerful than client based languages.
There are several server based languages :


PHP : very popular, you may have heard about it… Oh yes, I’ve been going on about it without telling you what it is icon biggrin HTML / CSS What Do We Do Now (Conclusion)
All you need to remember for the moment is that PHP is very popular with webmasters who have a bit of experience because it’s free and very powerful.


ASP : this language is less well known. ASP was developed by a business you know well: Microsoft. And as Microsoft rarely does things for free… icon biggrin HTML / CSS What Do We Do Now (Conclusion)
ASP has therefore been less successful than PHP because it’s expensive, and I’m sure you wouldn’t want to pay to be able to develop your own site (it’s a human feeling, don’t be ashamed icon wink HTML / CSS What Do We Do Now (Conclusion) ). It’s mainly businesses that use ASP. And yet… a lot of them are converting to PHP, which is just as powerful as ASP and has the advantage of being free.
There are other server based languages as well such as Perl but seeing as PHP has dominated them, I won’t bother going into detail about them.


Now we’ll talk in more detail about a client based language (JavaScript) and a server based language (PHP).


Javascript goes back quite a long time. It is, as I said earlier, a language that is launch on the client’s machine, meaning the visitor’s computer. It allows us to edit the XHTML code without having to reload the page all the time.


Contrarily to XHTML, Javascript is a programming language.
To give you an idea of what it’s like, here’s a bit of Javascript :


Code : JavaScript

function switch_spoiler(div2){ if (div2.getElementsByTagName('div').length > 0) var divs = div2.getElementsByTagName('div'); else var divs = div2.parentNode.nextSibling.getElementsByTagName('div'); var div3 = divs[0]; if (div3.style.visibility == 'visible') div3.style.visibility = 'hidden'; else div3.style.visibility = 'visible'; return false;}

This code changes the style of a tag when we click on it : it changes visibility to hidden if it was visible, and to visible if it was hidden. It lets us hide or show text on the screen when the visitor clicks on it.


We can write Javascript directly in a .html file, or better : in a .js file. (just like putting CSS in a .css file).


Javascript is difficult to resume in a couple of lines because it can produce a very large variety of effects :


We’ll use it often to change CSS properties without reloading the page.
For example, you roll over an image and the site’s background changes colour (we can’t do it with :hover because it concerns two different tags, that’s the limit of CSS).


We can use it to change the XHTML source code without reloading the page


It can be used to show dialog boxes on the screen


Or to change the size of a window…


Javascript is used in a very popular programming method at the moment, that you may have heard of : AJAX (Asynchronous JavaScript And XML). It’s a language that combines JavaScript and XML to communicates with servers and dynamically reload certain parts of the page. Services such as GMail and Netvibes use it a lot, and they’re not alone.


Server based languages and client based languages can’t be compared because they do different things. Therefore don’t try to compare JavaScript and PHP, these languages aren’t related.


I’ve told you about Javascript and explained that the need of this language is minimal. It is used to create certain effects (a lot of them…), but globally we can manage without it.
However, it’s practically impossible to manage without PHP. Yes, we can make a web site without PHP (the proof : you can do it), but in the end you’ll need PHP.


For example, it’s PHP that allows you to process the information that visitor’s put in forms, it’ll send the information to you by email for example. Here’s a few examples from many, many applications of PHP :

Guest BookForumsNewsletterChatVisitor CountersAutomatic News SystemsMember SystemsPHP Games for Websites (strategy games, role play games…)We’ll stop there shall we icon wink HTML / CSS What Do We Do Now (Conclusion)

PHP also has a very large community of programmers that’ll be able to help you out.
And it also has a mascot : the elePHPant :

php HTML / CSS What Do We Do Now (Conclusion)


PHP is quite different to XHTML and CSS because it’s a real programming language. It is a lot like C++ (the difference is that C++ is for programs, PHP is for websites).


There is one thing that PHP requires : that you already know XHTML and CSS. That’s alright for you, you’ve just learnt both of them icon biggrin HTML / CSS What Do We Do Now (Conclusion)


PHP will, to put things clearly, make your life easier (after having complicated things of course icon biggrin HTML / CSS What Do We Do Now (Conclusion) ).
It allows you to make your site, in some ways, completely automatic. A PHP site, is a site that updates itself without needing you to be sat in front of your screen.


So, to keep things simple, there are 2 types of site :


Sites in XHTML and CSS (that you can now do) : these sites work very well, but to update them you systematically need to change the XHTML / CSS. Generally these sites are quite simple, and often are small sites.
A site made in XHTML and CSS are called static, because they can’t be modified without your intervention.


Sites in XHTML + CSS + PHP : with the addition, the site is, in many ways, automated. Once the XHTML, CSS and PHP code has been set up, you won’t (hardly ever) need to touch the source code. For example, to add news you simply need to fill in a form and click on submit !
A site made in XHTML, CSS and PHP is called dynamic because it is a site that doesn’t really need your intervention to develop. A dynamic site is a lot more attractive and easier to update, which explains why most of the big sites use PHP.


Do you want a glimpse of PHP to see what it looks like ?


Code : PHP

ip is the address of the visitor $returnip = mysql_query('SELECT COUNT(*) AS number_entries FROM connected WHERE ip='' . $_SERVER[REMOTE_ADDR'] . '''); $datas = mysql_fetch_array($returnip); if ($datas['number_entries'] == 0) // The ip isn't in the table, we'll add it { mysql_query('INSERT INTO connected VALUES('' . $_SERVER['REMOTE_ADDR'] . '', ' . time() . ')' ); } else // The ip already exists, update the timestamp { mysql_query('UPDATE connected SET timestamp=' . time() . ' WHERE ip='' . $_SERVER['REMOTE_ADDR'] . '' ' ); }?>

It’s a bit of PHP code that allows you to show the number of visitors connected to your site icon smile HTML / CSS What Do We Do Now (Conclusion)


If I were you, I’d carry on practising XHTML and CSS, to be sure that you know them well, then read chapter 1 of the PHP tutorials.


Reading the 1st chapter doesn’t cost you anything, and it’ll give you a more clear idea of what PHP is like.
It would be a real shame if you didn’t learn this language.


This time my friends, it really is the end icon sad HTML / CSS What Do We Do Now (Conclusion)


What can I add before finishing ?


Well, first of all it’s been a pleasure sharing my knowledge and experience with you.
If you haven’t looked yet, there are cheat sheets after the chapters of the lesson. You’ll almost certainly find some extra and useful information in there. There are also some extra chapters such as How to put your site on the web, or How to earn money through advertising etc. etc…


As you can see, the world of computing holds lots of surprises, which, if we take the time to find and learn about, finish by astonishing us. It’s this curiosity that you need to keep, in computing, but also elsewhere.


 

PHP – Introduction To PHP

php banner PHP Introduction To PHP




What makes the success of the web today is its ease of access and its simplicity. A web surfer doesn’t need to know how everything works in the background.


On the other hand, novice web masters such as you must, before anything else, know the basics of the workings of a web site. What is a server and a client ? How do you make a dynamic site ? What are PHP and MySQL ?


This first chapter is here to answer all these questions and to show you that you are capable of making a dynamic web site.


Before we start I would like to thank our friends at Le Site Du Zero for letting me adapt their lessons. icon biggrin PHP Introduction To PHP


We’ll say that there are 2 types of web sites : static and dynamic sites.

elephant PHP Introduction To PHP

Static sites : they are sites made using (X)HTML & CSS. They work very well but their content can’t be updated automatically : the owner of the site (the webmaster) must modify the source code to add anything. It’s not very useful when your site needs updating several times a day ! Static sites are therefore useful for making show case web sites, for example to present a business or company, without going any further. This type of site is becoming rarer today, because as soon as you add an element for interaction (such as a contact form), we stop talking about static sites, but talk instead of dynamic sites.


Dynamic sites : more complicated, they use other languages as well as (X)HTML and CSS, such as PHP and MySQL. The content of these sites is said to be dynamic because it can be changed without the presence of the webmaster ! Most of the sites you use nowadays, including Euro PC Solutions, are dynamic sites. The only prerequisites you need to learn to make a dynamic web site is to already know how to make sites using (X)HTML and CSS (you can read my lessons on XHTML and CSS to learn this).


The purpose of these lessons is to make you capable of making a dynamic web site by yourself, step by step.
This allows you to make more exciting things than a static site. Here are some things you’ll be able to make after these lessons :

A member area : Visitors will be able to register to your site and access reserved areasA forum : Nowadays websites often propose forums to let people help each other out or just to discussA visitor counter : You can easily count the number of visitors that have been on your site or know the number that are currently browsing !News : You can automise the writing of news and give the visitors the possibility of adding news or comments etc.A newsletter : You can regularly send an email to all your visitors with the latest news and persuade them to visit your site again

Of course, these are only examples. It’s possible to go a lot further, everything depends on your needs. You should know for example that most online games are dynamic. You can find for example games for raising animals, conquering space etc. icon wink PHP Introduction To PHP


But…let’s not get carried away. Before getting there you have lots of things to learn ! Let’s start by the basics : do you know what happens when you open a web page ? icon wink PHP Introduction To PHP


When you want to visit a web site you write its address in your web browser, whether it’s Mozilla Firefox, Internet Explorer, Opera, Safari or another. But have you ever asked yourself how the web page gets to your computer ?


You need to know that the internet is a network of computers. These can be classed into 2 categories :


Clients : They are the computers of web surfers such as yourselves. Your computer is therefore a client. Each client represents a visitor on a web site. In the following diagrams, the computer of a client will be represented by this image :

pc PHP Introduction To PHP


Servers : These are very powerful computers that store web sites and send them out to client computers. Most web browsers will never see a server in their life. However, servers are necessary for the internet to work. Servers will be represented like this :

server PHP Introduction To PHP

Most of the time, a server doesn’t even have a screen : it stays on and works without human intervention, 24h/24, 7d/7


Quick summary : your computer is called a client and the computer that stores web sites is called a server. How do they communicate ? icon surprised PHP Introduction To PHP


That’s where the difference lies between a static site and a dynamic site. Let’s see what changes.


When a site is static, the diagram is very simple. There are 2 steps :

The client asks the server for a web pageThe server answers back by sending the web pagestatic1 PHP Introduction To PHP


The communication is therefore quite simple :

Hello, I’m the client, I would like to see a web pageThere you go, here’s the page you asked for

On a static site nothing else happens. The server stores the web pages and sends them to the client when asked for without modifying them.


When a site is dynamic, there is an intermediate step : the page is generated.

The client asks the server for a web pageThe server prepares the page specially for the clientThe server sends the page that has been generateddynamic PHP Introduction To PHP


The web page is generated each time that the client asks for it. That’s precisely what makes web sites dynamic : the content of the page can be changed from one moment to another.


That’s how some sites can show for example your username on every page. Because the server generates a new page every time a visitor asks for one, it can personalise the page depending on the visitor (and show the username among other things).


When we make web sites, we use not one, but several languages. As a webmaster you must know them.

Some programs, called WYSIWYG (What You See Is What You Get), allow beginners to make static web sites without knowing any of the languages…But to make a dynamic site like we want, you must know them.


A number of languages have been invented for creating web sites. Two of them are absolutely necessary for webmasters.


XHTML : Is the language at the root of every web site. It’s a lot like HTML but imposes some stricter rules. I recommend that you use XHTML instead of HTML because it makes you take care with your code.
XHTML is easy to learn and works with tags. Here’s an example of XHTML code :


Code : HTML


Hello, I'm a paragraph of text !


CSS : Is the language that creates the design of web sites. Whereas XHTML inserts the content of a site and creates the structure, CSS sorts out the design and look. It’s with CSS that we can choose the colour of the text, the size of the menu etc. Here’s an example of CSS :


Code : CSS

.banner { text-align: center; font-weight: bold; font-size: 120%;}

These languages are used on every web site. When a server sends a web page to the client, it sends the XHTML and CSS code.

html1 PHP Introduction To PHP


The problem is that when you only know XHTML and CSS, you can only make static sites…and not dynamic sites ! To make these you need to know other languages as well as XHTML and CSS.


The question you therefore need to ask yourself is : do you know XHTML and CSS ?


If the answer is yes, that’s perfect, you can continue because we’ll need it during these lessons. If the answer is no, don’t panic. XHTML and CSS aren’t very difficult, everyone can learn them. You can learn them by reading my XHTML and CSS lessons.
You can learn these languages in a couple of weeks, or less if you have enough spare time. icon smile PHP Introduction To PHP


Whatever the site you want to create, XHTML and CSS are indispensable. However, they aren’t enough to make a dynamic site. They need to be completed with other languages.


And that is the whole purpose of these lessons : you’ll learn to use PHP and MySQL to make dynamic sites.


PHP : It’s a language that only servers can understand and that allows us to make sites dynamic. It’s PHP that generates pages like we saw on the above diagrams.
It’s the first language that we’ll discover in these lessons. It can work by itself, but is only really interesting if it is combined with MySQL. Here is some PHP code :


MySQL : It’s what we call an RDBMS (Relational Database Management System). To keep things simple, its purpose is to store data in an organised way so that you can easily find and use it. It’s with MySQL that you’ll be able to store the number of visitors on your site, the messages written on a forum etc. The language that allows us to communcicate with a database is called SQL. Here’s some code written in SQL :


Code : SQL

SELECT id, author, message, datemsg FROM visitorbook, ORDER BY datemsg DESC LIMIT 0,10PHP and MySQL are what we call freeware. Among other things this guarantees lasting quality : everybody can contribute to the development, and there’s no risk of webmasters losing interest in it all of a sudden meaning that it would be dropped, and that is very important !
PHP and MySQL are also available for free. Because of that you won’t have to give away a penny to make your site ! icon wink PHP Introduction To PHP


PHP can work by itself and is enough to make a dynamic web site, but it becomes really interesting when it’s combined with an RDBMS such as MySQL. However to simplify things, we’ll forget MySQL for the moment and concentrate on PHP. icon biggrin PHP Introduction To PHP


Clients are incapable of understanding PHP code, they only know XHTML and CSS. Only the server can read PHP.


The role of PHP is to generate XHTML code (we can also generate CSS but it’s rarer) which is then sent to the client like a static site :

php PHP Introduction To PHP


PHP is a programming language that is used on many servers to make decisions. It’s PHP that decides what XHTML will be generated and sent to the client each time.


To understand the point of that, let’s take an example. In PHP we can write : If the visitor is a member on my site and he’s called Jonathan, show ‘Hello Jonathan’ on the web page. If he’s not a member, show ‘Hello’ and give him the choice of inscription.
It’s a very basic example of a dynamic site : depending on if you’re a member or not, you won’t see the same things and you won’t have access to the same things.


XHTML and CSS don’t have any competition because they’re standards. Everybody is supposed to know them and use them on every web site.


On the other hand, with dynamic sites, PHP and MySQL are far from being the only languages available. I can’t give you a complete list of alternatives, it would be too long (and boring !). However, for your general culture, you should know some of the other big names.


To start with, even though we often combine PHP and MySQL to make powerful dynamic sites, we shouldn’t mix up the two languages. The first has different elternatives to the second language.


Among the competition of PHP we can find :

ruby PHP Introduction To PHP

ASP .NET : designed by Microsoft, it uses the .net framework which is well known by C# developers (a framework is a collection of libraries which help developers). this language can be useful if you’re used to developing in C# and don’t want to learn too much new information.Ruby On Rails : this framework works with the Ruby language and lets you create dynamic sites quickly.Django : is similar to Ruby On Rails but uses Python instead of Ruby.Java and JSP (Java Server Pages) : more often called JEE, it is particularly used in the professional environment. It demands a certain strictness. The creation of a JEE project often takes longer to design but the system is appreciated by professionals and institutions.

I can’t give the names of all the competition here, but that should give you a good idea. For information, it is also possible to use C or C++, but it is complex and not necessarily adapted (in other words I don’t really recommend it icon biggrin PHP Introduction To PHP )

Which language should I choose ? Which is the best ?


With the subject of these tutorials, you’d expect me to instantly say PHP !. But no. In fact, everything depends on your programming knowledge. If you’ve already used Java, you will quickly be able to use JSP. If you know Python, Django will be good for you.


As for PHP, it’s distinguished from the other languages because of its large community that can quickly help you on the internet if you have problems. It’s an easy to use language that is ideal for beginners and professionals : Wikipedia and Facebook are examples of popular, famous sites that use PHP.


Well, there is no best choice. I recommend the language with which you are certain to get help if you have problems. In this sense, PHP is a very good choice.


As for databases, the choice is yet again very vast.
However, whereas PHP and its alternatives are normally free, that’s not the case with most RDBMS.


Among the competition of MySQL, I recommend you know (at least by name) :

oracle PHP Introduction To PHP

Oracle : is the most famous RDBMS, the most complete and the most powerful. Unfortunately you have to pay for it (and it’s very expensive), which means it is mainly used in large companies. However there are free versions of Oracle for those who want to learn it.Microsoft SQL Server : made by Microsoft, it is often combined with ASP .NET, although it can be used with any language. You do have to pay for it but there are limited free versions.PostgreSQL : is a free RDBMS like MySQL which offers some more advanced functions. However it still has some way to go compared to Oracle.SQLite : the simplest and smallest RDBMS. It is free like MySQL but has very few functions. Its main advantage is that it’s very small.

Once again this list isn’t complete but gives you an idea of what exists.
For information, MySQL is by far the most used free RDBMS. Among the professional, paid solutions, Oracle is the most advanced and used but its use is reserved for large companies because of its price.


So really, if your budget is limited, you don’t have a lot of choice for RDBMS. MySQL is the most used because it is free, and is used by a lot of people that can help you out.


As you have seen, there is a large choice of tools for making a dynamic site. Most of them are free.


Normally you should be able to combine these tools as you wish. For example, you can use PHP with a different RDBMS to MySQL, such as Oracle or PostgreSQL. MySQL can be used with any language : Java, Python, Ruby etc.


However, the PHP + MySQL combination is the most common. It’s not by coincidence that I’ve decided to write lessons on these two tools icon wink PHP Introduction To PHP


You should now have a good idea of what PHP and MySQL allow you to do. If you remember that PHP generates personalised XHTML for each visitor, and MySQL is for storing data, you already know the main idea.


 

Nuclear Missiles Go Offline after Computer Error

Sorry, I could not read the content fromt this page.Sorry, I could not read the content fromt this page.

View the original article here