Show sourcecode
The following files exists in this folder. Click to view.
aside.php
default.php
kmom02_pagestyle.php
kmom02_pagestyle.php~
kmom03_create_password.php
kmom03_get.php
kmom03_get.php~
kmom03_getform.php
kmom03_getform.php~
kmom03_postform.php
kmom03_postform.php~
kmom03_server.php
kmom03_session.php
kmom03_sessionchange.php
kmom03_sessiondestroy.php
kmom03_sessioninfo.php
kmom03_validate.php
kmom03_validate.php~
kmom03_validate.php~
68 lines UTF-8 Windows (CRLF)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
include("incl/config.php");
$title="Validera inkommande argument";
?>
<div id="content">
<article class="border" style="width:70%;">
<h1>Validera inkommande</h1>
<form method="post" action="?p=kmom03-validate">
<fieldset>
<legend>Exempel på formulär med get-metoden</legend>
<p>
<label for="input1">Användarkonto:</label><br>
<input id="input1" class="text" type="text" name="account">
</p>
<p>
<label for="input2">Lösenord:</label><br>
<input id="input2" class="text" type="password" name="password">
</p>
<p>
<input type="submit" name="doLogin" value="Login">
</p>
</fieldset>
</form>
<p>Du anropade sidan med följande querystring:
<code><?php echo htmlentities($_SERVER['QUERY_STRING']); ?></code></p>
<p><code>$_GET</code> innehåller följande:</p>
<pre><?php print_r($_GET); ?></pre>
<p><code>$_POST</code> innehåller följande:</p>
<pre><?php print_r($_POST); ?></pre>
<?php
if(isset($_POST['account']))
{
echo "<p>Kontot är definerat.</p>";
if(empty($_POST['account']))
{
echo "<p>Kontot är tomt.</p>";
}
else
{
if(is_numeric($_POST['account']))
{
echo "<p>Kontot består enbart av numeriska tecken.</p>";
}
else
{
echo "<p>Kontot består EJ av enbart numeriska tecken.</p>";
}
echo "<p>Med strip_tags ser kontot ut: '" . strip_tags($_POST['account']) . "'</p>";
}
}
else
{
echo "<p>Kontot är EJ definerat.</p>";
}
?>
<hr>
</article>
</div>