Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PHP es un lenguaje de código abierto muy popular, adecuado para desarrollo web
y que puede ser incrustado en HTML. Es popular porque un gran número de
páginas y portales web están creadas con PHP. Código abierto significa que es de
uso libre y gratuito para todos los programadores que quieran usarlo. Incrustado
en HTML significa que en un mismo archivo vamos a poder combinar código PHP
con código HTML, siguiendo unas reglas.
PHP se utiliza para generar páginas web dinámicas. Recordar que llamamos
página estática a aquella cuyos contenidos permanecen siempre igual, mientras
que llamamos páginas dinámicas a aquellas cuyo contenido no es el mismo
siempre. Por ejemplo, los contenidos pueden cambiar en base a los cambios que
haya en una base de datos, de búsquedas o aportaciones de los usuarios, etc.
¿Cómo trabaja PHP? El lenguaje PHP se procesa en servidores, que son potentes
ordenadores con un software y hardware especial. Cuando se escribe una
dirección tipo http://www.aprenderaprogramar.com/index.php en un navegador
web como Internet Explorer, Firefox o Chrome, ¿qué ocurre? Se envían los datos
de la solicitud al servidor que los procesa, reúne los datos (por eso decimos que
es un proceso dinámico) y el servidor lo que devuelve es una página HTML como
si fuera estática.
Por regla general este tipo de lenguaje suele ser utilizado para crear contenido
dinámico y poder interactuar con el usuario.
PHP también puede utilizar y presentar resultados en otros estándares de datos o
lenguajes propios de los desarrollos web, como XHTML y cualquier otro tipo de
ficheros XML. PHP puede autogenerar éstos archivos y almacenarlos en el sistema
de archivos en vez de presentarlos en la pantalla, utilizando estos ficheros para
generar contenido dinámico. Es decir, el contenido dinámico puede surgir de
otros sitios además de desde bases de datos.
PHP is a very popular open source language, suitable for web development and
that can be embedded in HTML. It is popular because a large number of pages
and web portals are created with PHP. Open source means that it is free to use
and free for all programmers who want to use it. Embedded in HTML means that
in the same file we will be able to combine PHP code with HTML code, following
some rules.
PHP is used to generate dynamic web pages. Remember that we call a static
page whose contents always remain the same, while we call dynamic pages those
whose content is not always the same. For example, the contents may change
based on changes in a database, searches or contributions from users, etc.
How does PHP work? The PHP language is processed on servers, which are
powerful computers with special software and hardware. When you write a type
address http://www.aprenderaprogramar.com/index.php in a web browser such
as Internet Explorer, Firefox or Chrome, what happens? The data of the request is
sent to the server that processes them, gathers the data (that is why we say it is
a dynamic process) and the server returns an HTML page as if it were static.
The scheme is: Request web page to the server -> The server receives the
request, gathers the necessary information by consulting databases or other
websites, other servers, etc. -> The server responds by sending a "normal" web
page (static) but whose creation has been dynamic (making processes so that the
web page returned is not always the same).
In a dynamic site, the information is usually contained in a database. Every time
we show the page, such as a news page, we search the database for the latest
news we have entered to display in the visitor's browser. Now, how do you get the
page to show new news? Simply loading the same in the database, for example,
through a form filled in by a person and once filled when you press "Send" implies
that what you have written is stored in our database. In this way, when we
request the web page and the server, consult the database, you will find this new
information and it will show our page in a different way than what was seen
before.
As a rule this type of language is usually used to create dynamic content and
interact with the user.
PHP can also use and present results in other data standards or languages specific
to web developments, such as XHTML and any other type of XML files. PHP can
autogenerate these files and store them in the file system instead of presenting
them on the screen, using these files to generate dynamic content. That is,
dynamic content can arise from other sites as well as from databases.
You can also interact with other servers using any protocol. Finally, PHP can link
to other very powerful languages such as Java.