code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>PHP automatische tabel voorbeeld</title>
</head>
<body>
<? // Een klein PHP voorbeeld om een tabel te maken
// met informatie die je opgeeft (variabelen)
// Voer het uit met
// table.php?rows=4&cols=2
// Gebruik deze variabelen om te testen.
//$cols = 8;
//$rows = 6;
print ("Je hebt $cols kolommen en $rows rijen gespecificeerd. \n");
echo "<table border=1 color='#000000' bgcolor='#808080'>";
for ($rownr = 0; $rownr < $rows; $rownr++) {
echo "<tr>";
for ($colnr = 0; $colnr < $cols; $colnr++) {
echo "<td>$rownr - $colnr</td>";
}
echo "</tr>";
}
echo "</table>";
?>
</body>
</html> |
Als ik dit script aanroep via http://www.handwegkerk.nl/table.php?rows=4&cols=2
waarom werkt het dan niet?
Ik heb exact die PHP code overgenomen, maar het lijkt alsof hij de variabelen $rows en $cols niet 'pakt'.
(sorry voor hoog newbie gehalte in deze vraag)