Week 7 – More PHP


rosaliesammut

Continuing on last week’s lesson, more PHP code was introduced. During this lecture, we have learned the use of PHP in forms, sending an e-mail through PHP, PHP functions, cookies, sessions and page redirection.

$_GET and $_POST

The $_GET and $_POST variables are used collect data from a form in an HTML document. The difference between the $_GET and $_POST is that when the $_GET is used, all variable values are visible in the URL while in the $_POST variables are not visible in the URL.

PHP cookies

A cookie is a small file that the server embeds on the user’s computer used to identify a user. Each time the same computer requests a page with a browser, it will send the cookie too.  To create a cookie the setcookie() function is used in the following format: setcookie(name, value, expire, path, domain); The $_cookie variable is used to retrieve a cookie value in PHP. It…

View original post 127 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s