Skip to content

tgs modul 1 PHP

March 16, 2011

<!–DOCTYPE html>
<head>
Tabel <span class=”hiddenSpellError” pre=”Tabel “>Dinamik</span>
<style type=”text/css”>
<!–
.style1 {
color: #000000;
font-family: arial;
font-size:60px;
font-weight: bold;
}
–>
</style>
</head>

<body bgcolor=”#0066FF”>
<blockquote>
Tabel Dinamik
<p>
php

$html = ‘<html>
<head>
<span class=”hiddenSpellError” pre=””>php</span> tabel generated
</head>

<body>
<form method=”post”>
<p> <strong>CEL count : </strong>
<input name=”cel” type=”text” value=”” /></p>
<p> <strong>COL count : </strong>
col” type=”text” value=”” /> 
<p> <input type=”submit” name=”click” value=”Generate” /></p>
</form>’;

$clicked = $_POST[‘click’];
if (isset($clicked)) {
$cel = (int) $_POST[‘cel’];
$col = (int) $_POST[‘col’];

$html.= ‘<table border=”1px” cellspacing=”0″>
<tr>’;
for ($count=1; $count<=$cel; $count++) {
$html.= ‘<td width=\”60\” height=\”60\”>
<div align=”center”>’.$count.'</div>
</td>’;
if ($count % $col == 0) $html.= ”;
}
$html.= ‘</tr>
</table>’;
}

$html.= ‘</body>
</html>’;

echo $html;

?>
</p>
</blockquote>
</body>
</html>

No comments yet

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

%d bloggers like this: