One of the great things about PHP is that it was originally created specifically for creating dynamic web user interfaces and it is simple to start doing that. There are also a number of capabilities for interacting with browsers and servers, including cookies, HTTP headers, and server modules.
Cookies are something that most users do not like and should not be necessary for bioinformatics
programming. Having said that they are essential for a couple of tasks. Most importantly, they
are the best tool for creating user sessions. This is handled automatically by the PHP
framework. Cookies may be manipulated in PHP using the function setcookie and
read using the request variable $_COOKIE.
A user can be redirected to a different page by setting a Location header. This
is demonstrated below.
The full URL not just the path is needed for the header.
When building a query string for a HTTP GET request you need to be careful about special characters
like spaces, #, etc. The PHP function http_build_query() assists with this. For
example,
The spaces are converted to + and the +/ symbols are converted to the hexadecimal
equivalents. The output of this program is
There are no user comments.
Please send ideas and opinions by email at alexamies@gmail.com.