Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

28 December 2013

Top 7 Reasons Why You Need a Personal Website for personal websites

Top 7 Reasons Why You Need a Personal Website

Having a website of your own equals entering into an invaluable communication environment. There are at least 7 reasons why it is highly advisable for you to be present online:

1. Represents your personal profile
A website can be your virtual portrait, showing off your personal self to the world on a 24/7 basis.  Among the most popular ways of presenting your personality online is keeping a webblog (otherwise known as online diary) or aphoto gallery, where your friends can stay up-to-date with your daily living.
2. Spreads your voice across the world
A website can be your global “tribune” where you are able to share your knowledge, experience and enthusiasm with people who have common interests, but with whom you might not otherwise have crossed paths. A very popular idea-voicing tool is the discussion board, better known as “forum”. You can also have a guestbook on your site, where people can discuss your postings.
3. Lets you be in touch with people at a distance
A website can be a meeting place for making new acquaintances with people of different religion, nationality and age, as well as for keeping in touch with friends who may be on the other side of the world. Thanks to the almost unlimited online communication possibilities you can conduct one-to-one conversations with many different people directly from your website.
4. Broadens disabled people’s interaction with the world
A website empowers people with limited access, due to handicap or illness, to broaden their communication with others. A website can be a physically disabled person’s door to the dynamic world, allowing him/her to bridge over the difficulties of having a “different” everyday life. It can even be their office, where they can present and deliver certain home-made products/services directly from their living room.
5. Creates a web skill development environment
A website can introduce you to the secrets of www. The contemporary web design technologies have brought the art of creating a website just a few clicks away from the inexperienced user. Thanks to the popular WYSWYG(what you see is what you get) web design tools, absolutely everyone (irrespective of age or education degree) can build their own web page without any previous experience.
6. Makes extra profit for you with minimum investment on your part
A website can make residual profit for you, while you are sleeping or enjoying your free time. Thanks to the up-to-date techniques for bringing traffic to your website, you can earn easy money by simply having visitors click on certain product/service promos or links that are relevant to your site content pages (e.g. Google Adsense/Adwords ad solutions) without any initial investment.
7. Makes you a member of the biggest community of the world
A website is a must-have personal attribute nowadays, just like mobile phones and computers are. The fast developing technologies have converted having a website from a whim into a modern necessity. As of today, almost everyone has a web site, whereas twice as many people are expected to be having their own personal space in the global World Wide Web cosmos in the near future. Be forward-thinking, join this trend now.

09 July 2012

PHP - Rediriger sur une autre page, "redirect"


IMPORTANT : Les en-têtes HTTP

Les redirections sont des en-têtes HTTP. Or, selon le protocole HTTP, les en-têtes HTTP doivent être envoyés avant tout autre type de contenu, ce qui signifie qu'aucun caractère ne doit être envoyé avant l'appel de la fonction header, pas même un espace ! 

En d'autre termes, la fonction header() doit impérativement être utilisée avant tout code HTML

Redirection simple

Pour rediriger le visiteur vers une autre page (particulièrement utile dans une boucle conditionnelle), il suffit d'utiliser le code suivant : 
<?php   
  header('Location: mapage.php');   
?>


Où mapage.php représente l'adresse de la page vers laquelle vous voulez rediriger. Cette adresse peut être absolue et peut également posséder des paramètres de la forme mapage.php?param1=val1¶m2=val2). 

Chemin relatif / absolu

Dans l'idéal, préférez un chemin absolu à partir de la racine du serveur (DOCUMENT_ROOT), de la forme suivante : 
<?php   
  header('Location: /repertoire/mapage.php');   
?>


Si jamais la page cible est sur un autre serveur, vous mentionner l'URL complète, de la forme suivante : 
<?php   
  header('Location: http://www.commentcamarche.net/forum/');   
?>

Redirections temporaires/définitives

Par défaut, le type de redirection présenté ci-dessus est une redirection temporaire. Ce qui signifie notamment que les moteurs de recherche tels que Google ne la prennent pas en compte pour le référencement. 

Ainsi, si vous souhaitez signifier aux moteurs de recherche que la page A est maintenant à l'emplacement B, il faut utiliser le code suivant en tout début du fichier PHP correspondant à la page A : 

<?php 
  header('Status: 301 Moved Permanently', false, 301);   
  header('Location: adresse_de_la_page_B');   
?>

Exemple

La page possède le code suivant : 

<?     
  header('Status: 301 Moved Permanently', false, 301);   
  header('Location: /pc/imprimante.php3');   
  exit();     
?>


Ainsi, lorsque vous cliquez sur le lien ci-dessus, vous êtes automatiquement transféré sur la page 

De plus, il s'agit d'une redirection permanente (Status: 301 Moved Permanently). Ainsi, si vous tapez la première URL dans Google, celui-ci vous donnera comme résultat l'adresse de la seconde, preuve qu'il a pris en compte la redirection 

Interprétation du code PHP

Le code PHP situé après l'appel de la fonction header() sera interprété par le serveur, même si le visiteur est déjà parti à l'adresse spécifiée dans la redirection, ce qui signifie que dans la plupart des cas vous avez intérêt à faire suivre la fonction header() de la fonction exit() afin de ne pas faire travailler le serveur pour rien : 

<?php 
  header('Status: 301 Moved Permanently', false, 301);   
  header('Location: adresse');   
  exit();   
?>

15 February 2012

What is Symfony?


Symfony is a full-stack framework, a library of cohesive classes written in PHP.
It provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to release your applications earlier, host and scale them without problem, and maintain them over time with no surprise.
Symfony is based on experience. It does not reinvent the wheel: it uses most of the best practices of web development and integrates some great third-party libraries.
Thousands of developers already trust symfony for their applications!
New users join the community every day, and that makes of symfony the most popular PHP framework around. A large community means easy-to-find support, user-contributed documentation, plugins, and free applications
Open-Source PHP Web Framework