Beruflich Dokumente
Kultur Dokumente
Answers:
1.
a. $_GET Variable
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of PHP GET method</title>
</head>
<body>
<?php
if(isset($_GET["name"])){
echo "<p>Hi, " . $_GET["name"] . "</p>";
}
?>
<form method="get" action="<?php echo $_SERVER["PHP_SELF"];?>">
<label for="inputName">Name:</label>
<input type="text" name="name" id="inputName">
<input type="submit" value="Submit">
</form>
</body>
b. $_POST Variable
An associative array of variables passed to the current script via the HTTP
POST method when using application/x-www-form-urlencoded or
multipart/form-data as the HTTP Content-Type in the request.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of PHP POST method</title>
</head>
<body>
<?php
if(isset($_POST["name"])){
echo "<p>Hi, " . $_POST["name"] . "</p>";
}
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
<label for="inputName">Name:</label>
<input type="text" name="name" id="inputName">
<input type="submit" value="Submit">
</form>
</body>
2. Form Attribute
action - This attribute specifies a form processing agent. User agent behavior for
a value other than an HTTP URI is undefined.
method - get|post This attribute specifies which HTTP method will be used to
submit the form data set. Possible (case-insensitive) values are "get" (the
default) and "post". See the section on form submission for usage information.
enctype - This attribute specifies the content type used to submit the form to the
server (when the value of method is "post"). The default value for this attribute
is "application/x-www-form-urlencoded". The value "multipart/form-data" should
be used in combination with the INPUT element, type="file".
2
accept-charset - charset list This attribute specifies the list of character
encodings for input data that is accepted by the server processing this form. The
value is a space- and/or comma-delimited list of charset values. The client must
interpret this list as an exclusive-or list, i.e., the server is able to accept any
single character encoding per entity received.
The default value for this attribute is the reserved string "UNKNOWN". User
agents may interpret this value as the character encoding that was used to
transmit the document containing this FORM element.
3. CSS Colors
CSS has several options for defining colors of both text and background areas on
your pages.
These options can entirely replace the color attributes in plain HTML. In addition,
you get new options that you just didn't have in plain HTML.
For example, in plain HTML, when you wanted to create an area with a specific
color you were forced to include a table. With CSS, you can define an area to
have a specific color without that area being part of a table.
Or even more useful, in plain HTML when working with tables, you had to specify
font attributes and colors etc. for each and every table cell. With CSS you can
simply refer to a certain class in your <TD> tags.
COLOR PROPERTIES
Property Values NS IE
Color <color> 4+ 4+
transparent 4+ 4+
background-color
<color> 4+ 4+
none 4+ 4+
background-image
url(<URL>) 4+ 4+
repeat 4+ 4+
repeat-x 4+ 4+
background-repeat
repeat-y 4+ 4+
no-repeat 4+ 4+
scroll 4+
background-attachment
fixed 4+
background-position <percentage> 4+
<length> 4+
top 4+
center 4+
3
bottom 4+
left 4+
right 4+
<background-color> 4+ 4+
<background-image> 4+ 4+
background <background-repeat> 4+ 4+
<background-attachment> 4+
<background-position> 4+
Setting colors
In the next section we will list the different properties that let you
do that.
In plain HTML, colors can either be entered by name (red, blue etc.) or by a
hexadecimal color code (for example: #FF9900).
Common name
You can define colors with the use of common names, by
simply enter the name of the desired color.
For example:
Hexadecimal value
You can define colors with the use of hexadecimal values,
similar to how it's done in plain HTML.
For example:
RGB value
You can define colors with the use of RGB values, by simply
entering the values for amounts of Red, Green and Blue.
4
For example:
You can also define RGB colors using percentage values for
the amounts of Red, Green and Blue:
For example:
Background colors are defined similar to the colors mentioned above. For example you
can set the background color of the entire page using the BODYselector:
BODY {background-color:#FF6666;}
You can define the background image for the page like this:
BODY {background-image:url(myimage.gif);}
You can control the repetition of the image with the background-repeatproperty.
background-repeat:repeat
Tiles the image until the entire page is filled, just like an
ordinary background image in plain HTML.
background-repeat:repeat-x
Repeats the image horizontally - but not vertically.
background-repeat:repeat-y
Repeats the image vertically - but not horizontally.
background-repeat:no-repeat
Does not tile the image at all.
Positioning a background
5
Background positioning is done by entering a value for the left position and top position
separated by a space.
In this example the image is positioned 75 pixels from the upper left corner of the page:
Fixing a background
You can fixate an image at a certain position so that it doesn't move when scrolling
occurs.
CSS NTH
One way to improve the readability of large tables is to color alternating rows. For
example, the table below has a light gray background for the even rows and white for
the odd ones. The rules for that are extremely simple:
6
Aug 29 28 27 28 28 27 26 28 26
Sep 24 23 23 26 24 24 24 22 21
Oct 20 22 20 22 20 19 20 22
Nov 18 17 16 17 16 15 14 15
Dec 15 13 13 14 13 10 13 11
In fact, CSS allows not only allow even/odd alternations, but arbitrary intervals. The
keywords 'even' and 'odd' are just convenient shorthands. For example, for a long list
you could do this:
This says that every 5th list item is bold, starting with the 3rd one. In other words, the
items numbered 3, 8, 13, 18, 23, etc., will be bold.
The same works for table columns, too, but then there has to be an element in the
document that corresponds to the column. HTML provides COL for that. The table has
to start with one COL for every column:
<table>
<col><col><col><col><col><col><col><col><col><col>
<tr><th>Month<th>'94<th>'95<th>'96...
(COL can be used for other things than style, but in this case all we need is that the
COL elements are present.) The following rules give the first column a yellow
background, and then every second column starting from column 3 a gray one:
The background of rows (TR) is drawn in front of the background of columns (COL), so
if you want to be sure that the background of the columns is visible, you should not set a
background on the rows.
Sources:
7
http://www.tutorialrepublic.com/php-tutorial/php-get-and-post.php
https://www.w3.org/TR/html401/interact/forms.html
https://developer.mozilla.org/en/docs/Web/CSS/color_value
https://www.w3.org/Style/Examples/007/evenodd.en.html