maak-beheer-pagina

Gesponsorde koppelingen

PHP script bestanden

  1. maak-beheer-pagina

« Lees de omschrijving en reacties

///////////////////////////////////////////////////////////////
/////////////////////// index.php ///////////////////////////
///////////////////////////////////////////////////////////////

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?

if($_POST['maak']){

echo "<script language='JavaScript'> document.location = 'index2.php?f=".$HTTP_POST_VARS['velden']."'; </script>";

}
else {

echo "<form method='post' target='_self'>";

echo "Aantal velden <input type='text' name='velden'><br>";
echo "<input type='submit' name='maak' value='Naar stap 2'>";

echo "</form>";

}


?>


///////////////////////////////////////////////////////////////
/////////////////////// index2.php //////////////////////////
///////////////////////////////////////////////////////////////

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?

if($_POST['maak']){

?>


<textarea cols='100' rows='30'>

<html>
<head>
<style type='text/css'>

body {
background-image: url('doc/background.gif');
background-color: #FFFFFF;
color: #000000;
}

A {
color: #000000;
text-decoration:none;
}
A:hover {
color: #000000;
text-decoration:none;
}
A:active{
color: #000000;
text-decoration:none;
}
A:visited{
color: #000000;
text-decoration:none;
}

table { font-size: 10px; font-family: Verdana, Arial; }

td.main {
background-color: #FFFFFF;
color: #000000;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-color: #000000;
border-top-width: 1;
border-left-width: 1;
border-right-width: 1;
border-bottom-width: 1;
}

td.none {
background-color: #FFFFFF;
color: #000000;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-color: #000000;
border-top-width: 0;
border-left-width: 0;
border-right-width: 0;
border-bottom-width: 0;
}

td.main_r {
background-color: #FFFFFF;
color: #000000;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-color: #000000;
border-top-width: 1;
border-left-width: 0;
border-right-width: 1;
border-bottom-width: 1;
}

hr {
background-color:#000000;
color: #000000;
border-style: solid;
border-width: 0px;
border-color:#000000;
background-image: none;
height: 1pt;
}

</style>
</head>
<body>

<table><tr><td>

&lt;?

$host =
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['host']; ?>
;
$user =
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['user']; ?>
;
$ww =
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['pass']; ?>
;
$db =
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['db']; ?>
;

mysql_connect("$host","$user","$ww");
mysql_select_db("$db")or die (mysql_error());

function afkorten($string, $lenght, $end = '<font color=red>...</font>')
{
if (strlen($string) > $lenght)
{
$lenght -= strlen($end);
$last = strrpos(substr($string, 0, $lenght + 1), ' ');
return substr($string, 0, (!$last)? $lenght: $last) . $end;
}
return $string;
}

$functie = $_GET['f'];
if($functie == ""){ $functie = "b"; }

if($functie == "b"){

echo "<hr>";
echo "Bekijken";
echo "<hr>";

echo "<table width='100%' cellspacing='5'>";

echo "<tr>";

echo "<td class='none'><b>ID</b></td>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller = 1; while($teller <= $_GET['f']){ ?>


echo "<td class='none'><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
</b></td>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($HTTP_POST_VARS['sorteer'] == 0){ $sorteer = "id"; } else if($teller == $HTTP_POST_VARS['sorteer']){ $sorteer = $HTTP_POST_VARS[$teller]; } ?>


Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller++; } ?>


echo "<td class='none'><b>Verwijderen</b></td>";
echo "<td class='none'><b>Wijzigen</b></td>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($HTTP_POST_VARS['desk'] == 1){ ?>

$select = mysql_query("SELECT * FROM
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['tabel']; ?>
ORDER BY
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $sorteer; ?>
DESC") or die(mysql_error());
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } else { ?>

$select = mysql_query("SELECT * FROM
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['tabel']; ?>
ORDER BY
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $sorteer; ?>
") or die(mysql_error());
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>


while($row = mysql_fetch_array($select)){

echo "<tr>";

echo "<td class='none'>".$row['id']."</td>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller = 1; while($teller <= $_GET['f']){ ?>


echo "<td class='none'>".afkorten($row['
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
'],'
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['afkorten']; ?>
')."</td>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller++; } ?>


echo "<td class='none' align='right'><a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
?f=v&fid=".$row['id']."'><font color='red'><b>V</b></font></a></td>";
echo "<td class='none' align='right'><a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
?f=w&fid=".$row['id']."'><font color='darkorange'><b>W</b></font></a></td>";

echo "</tr>";

}

echo "</table>";

echo "<hr>";
echo "<a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
?f=t'>Voeg een record toe</a>";
echo "<hr>";

} else if($functie == "v"){

$verwijder_id = $_GET['fid'];

$delete = mysql_query("DELETE FROM
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['tabel']; ?>
WHERE id = '$verwijder_id'") or die(mysql_error());

echo "Record #".$verwijder_id." is verwijderd.<br>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($HTTP_POST_VARS['terug'] == 1){ ?>

echo "<script language='JavaScript'> document.location = '
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'; </script>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } else { ?>

echo "<a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'>Terug</a>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>


} else if($functie == "t"){

if($_POST['toevoegen']){

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller = 1; while($teller <= $_GET['f']){ ?>

$
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
= $HTTP_POST_VARS['
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
'];
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller++; } ?>


$toevoegen = "INSERT INTO
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['tabel']; ?>
(
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
<? $teller = 1; while($teller <= $_GET['f']){

            if($teller != 1){

                echo ",";

            }


            echo $HTTP_POST_VARS[$teller];

        $teller++; } ?>


) VALUES (
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
<? $teller = 1; while($teller <= $_GET['f']){

            if($teller != 1){

                echo ",";

            }


            echo "'$".$HTTP_POST_VARS[$teller]."'";

        $teller++; } ?>


)";

mysql_query($toevoegen) or die(mysql_error());

echo "Record is toegevoegd.<br>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($HTTP_POST_VARS['terug'] == 1){ ?>

echo "<script language='JavaScript'> document.location = '
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'; </script>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } else { ?>

echo "<a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'>Terug</a>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>


} else {

echo "<hr>";
echo "<b>Voeg een record toe</b>:";
echo "<hr>";

echo "<form method='post' target='_self'>";
echo "<table>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller = 1; while($teller <= $_GET['f']){ ?>


echo "<tr>";
echo "<td class='none'><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
</b></td>";
echo "<td class='none'>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
<? $type_teller = "type_".$teller;
    if($HTTP_POST_VARS[$type_teller] == "textarea"){ ?>

echo "<textarea cols='30' rows='7' name='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
'>&lt;/textarea>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } else { ?>

echo "<input type='text' name='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
'>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>


echo "</td>";
echo "</tr>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller++; } ?>


echo "<tr>";
echo "<td class='none'><input type='submit' name='toevoegen' value='Voeg record toe'><br>";
echo "<a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'>Terug</a></td>";
echo "</tr>";

echo "</table>";
echo "</form>";

}

} else if($functie == "w"){

$wijzig_id = $_GET['fid'];

if($_POST['wijzigen']){

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller = 1; while($teller <= $_GET['f']){ ?>

$
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
= $HTTP_POST_VARS['
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
'];
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller++; } ?>


$wijzigen = mysql_query("UPDATE
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['tabel']; ?>
SET

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
<? $teller = 1; while($teller <= $_GET['f']){

            if($teller != 1){

                echo " , ";

            }


            echo $HTTP_POST_VARS[$teller]; ?>
= '$
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
'
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?

         $teller
++; } ?>


WHERE id = '$wijzig_id' LIMIT 1") or die(mysql_error());

echo "Record is gewijzigd.<br>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($HTTP_POST_VARS['terug'] == 1){ ?>

echo "<script language='JavaScript'> document.location = '
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'; </script>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } else { ?>

echo "<a href='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['p_url']; ?>
'>Terug</a>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>


} else {

echo "<hr>";
echo "<b>Wijzig een record</b>:";
echo "<hr>";

$record_select = mysql_query("SELECT * FROM
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS['tabel'] ?>
WHERE id = '$wijzig_id' LIMIT 1");
while($row = mysql_fetch_array($record_select)){

echo "<form method='post' target='_self'>";
echo "<table>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller = 1; while($teller <= $_GET['f']){ ?>


echo "<tr>";
echo "<td class='none'><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
</b></td>";
echo "<td class='none'>";


Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
<? $type_teller = "type_".$teller;
        if($HTTP_POST_VARS[$type_teller] == "textarea"){ ?>

echo "<textarea name='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
' cols='30' rows='7'>".$row['
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
']."&lt;/textarea>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } else { ?>

echo "<input type='text' name='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
' value='".$row['
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? echo $HTTP_POST_VARS[$teller]; ?>
']."'>";
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>


echo "</td>";
echo "</tr>";

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? $teller++; } ?>


echo "<tr>";
echo "<td class='none'><input type='submit' name='wijzigen' value='Wijzig dit record'></td>";
echo "</tr>";

echo "</table>";
echo "</form>";

}

}

}

?&gt;

</td></tr></table>

</body>
</html>

</textarea>

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
69
70
71
72
73
74
<?

} else {

$fields = $_GET['f'];
$teller = 1;

echo "<form method='post' target='_self'>";

echo "Tabel <input type='text' name='tabel'><br>";
echo "&nbsp;<br>";

echo "Host <input type='text' name='host' value='localhost'><br>";
echo "DB - naam <input type='text' name='db'><br>";
echo "Gebruiker <input type='text' name='user'><br>";
echo "Wachtwoord <input type='password' name='pass'><br>";
echo "&nbsp;<br>";

echo "Url pagina <input type='text' name='p_url' value='index.php'><br>";
echo "&nbsp;<br>";

echo "Maximale lengte te weergeven text <input type='text' name='afkorten' value='125'><br>";
echo "&nbsp;<br>";

echo "Na toevoegen direct terug (anders eerst melding) <input type='checkbox' name='terug' value='1'><br>";
echo "&nbsp;<br>";

echo "Sorteren omdraaien <input type='checkbox' value='1' name='desk'><br>";
echo "&nbsp;<br>";

echo "<table>";

echo "<tr>";
echo "<td><b>#</b></td>";
echo "<td><b>Naam</b></td>";
echo "<td><b>Sorteer</b></td>";
echo "<td><b>Type</b></td>";
echo "</tr>";

echo "<tr>";
echo "<td>-</td>";
echo "<td>ID</td>";
echo "<td><input type='radio' name='sorteer' value='0' CHECKED></td>";
echo "<td>-</td>";
echo "</tr>";

while($teller <= $fields){

    echo "<tr>";
    echo "<td>".$teller."</td>";
    echo "<td><input type='text' name='".$teller."'></td>";

    echo "<td><input type='radio' name='sorteer' value='".$teller."'></td>";

    echo "<td>";
    echo "<input type='radio' name='type_".$teller."' value='input' CHECKED>Input&nbsp;&nbsp;&nbsp;";
    echo "<input type='radio' name='type_".$teller."' value='textarea'>Textarea";
    echo "</td>";
    echo "</tr>";

    $teller ++;

}


echo "</table>";

echo "&nbsp;<br>";
echo "<input type='submit' name='maak' value='Maak pagina'>";

echo "</form>";

}


?>


///////////////////////////////////////////////////////////////
/////// voorbeeld van een gegenereerde code //////////
///////////////////////////////////////////////////////////////


<html>
<head>
<style type='text/css'>

body {
background-image: url('doc/background.gif');
background-color: #FFFFFF;
color: #000000;
}

A {
color: #000000;
text-decoration:none;
}
A:hover {
color: #000000;
text-decoration:none;
}
A:active{
color: #000000;
text-decoration:none;
}
A:visited{
color: #000000;
text-decoration:none;
}

table { font-size: 10px; font-family: Verdana, Arial; }

td.main {
background-color: #FFFFFF;
color: #000000;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-color: #000000;
border-top-width: 1;
border-left-width: 1;
border-right-width: 1;
border-bottom-width: 1;
}

td.none {
background-color: #FFFFFF;
color: #000000;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-color: #000000;
border-top-width: 0;
border-left-width: 0;
border-right-width: 0;
border-bottom-width: 0;
}

td.main_r {
background-color: #FFFFFF;
color: #000000;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-color: #000000;
border-top-width: 1;
border-left-width: 0;
border-right-width: 1;
border-bottom-width: 1;
}

hr {
background-color:#000000;
color: #000000;
border-style: solid;
border-width: 0px;
border-color:#000000;
background-image: none;
height: 1pt;
}

</style>
</head>
<body>

<table><tr><td>

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?

$host
= localhost;
$user = netersel_koen;
$ww = koen;
$db = netersel_koen;

mysql_connect("$host","$user","$ww");
mysql_select_db("$db")or die (mysql_error());

function
afkorten($string, $lenght, $end = '<font color=red>...</font>')    
{
    
    if (strlen($string) > $lenght)    
    {
    
        $lenght -= strlen($end);    
        $last = strrpos(substr($string, 0, $lenght + 1), ' ');    
        return substr($string, 0, (!$last)? $lenght: $last) . $end;    
    }
    
    return $string;    
}


$functie = $_GET['f'];
if($functie == ""){ $functie = "b"; }

if($functie == "b"){

    echo "<hr>";
    echo "Bekijken";
    echo "<hr>";

    echo "<table width='100%' cellspacing='5'>";

    echo "<tr>";

    echo "<td class='none'><b>ID</b></td>";

        
    echo "<td class='none'><b>type</b></td>";

    
        
    echo "<td class='none'><b>naam</b></td>";

    
        
    echo "<td class='none'><b>url</b></td>";

    
        
    echo "<td class='none'><b>info</b></td>";

    
        
    echo "<td class='none'><b>Verwijderen</b></td>";
    echo "<td class='none'><b>Wijzigen</b></td>";

        $select = mysql_query("SELECT * FROM domeininfo ORDER BY id DESC") or die(mysql_error());
    
    while($row = mysql_fetch_array($select)){

    echo "<tr>";

    echo "<td class='none'>".$row['id']."</td>";

        
    echo "<td class='none'>".afkorten($row['type'],'125')."</td>";

        
    echo "<td class='none'>".afkorten($row['naam'],'125')."</td>";

        
    echo "<td class='none'>".afkorten($row['url'],'125')."</td>";

        
    echo "<td class='none'>".afkorten($row['info'],'125')."</td>";

        
    echo "<td class='none' align='right'><a href='test.php?f=v&fid=".$row['id']."'><font color='red'><b>V</b></font></a></td>";
    echo "<td class='none' align='right'><a href='test.php?f=w&fid=".$row['id']."'><font color='darkorange'><b>W</b></font></a></td>";

    echo "</tr>";

    }


    echo "</table>";

    echo "<hr>";
    echo "<a href='test.php?f=t'>Voeg een record toe</a>";
    echo "<hr>";

}
else if($functie == "v"){

    $verwijder_id = $_GET['fid'];

    $delete = mysql_query("DELETE FROM domeininfo WHERE id = '$verwijder_id'") or die(mysql_error());

    echo "Record #".$verwijder_id." is verwijderd.<br>";
    echo "<script language='JavaScript'> document.location = 'test.php'; </script>";
    
}
else if($functie == "t"){

    if($_POST['toevoegen']){

        $type = $HTTP_POST_VARS['type'];
        $naam = $HTTP_POST_VARS['naam'];
        $url = $HTTP_POST_VARS['url'];
        $info = $HTTP_POST_VARS['info'];
        
        $toevoegen = "INSERT INTO domeininfo (
        type,naam,url,info
        ) VALUES (
        '$type','$naam','$url','$info'
        )"
;

        mysql_query($toevoegen) or die(mysql_error());

        echo "Record is toegevoegd.<br>";
            echo "<script language='JavaScript'> document.location = 'test.php'; </script>";
        
    }
else {

    echo "<hr>";
    echo "<b>Voeg een record toe</b>:";
    echo "<hr>";

    echo "<form method='post' target='_self'>";
    echo "<table>";

        
    echo "<tr>";
    echo "<td class='none'><b>type</b></td>";
    echo "<td class='none'>";

    echo "<input type='text' name='type'>";
    
    echo "</td>";
    echo "</tr>";

        
    echo "<tr>";
    echo "<td class='none'><b>naam</b></td>";
    echo "<td class='none'>";

    echo "<input type='text' name='naam'>";
    
    echo "</td>";
    echo "</tr>";

        
    echo "<tr>";
    echo "<td class='none'><b>url</b></td>";
    echo "<td class='none'>";

    echo "<input type='text' name='url'>";
    
    echo "</td>";
    echo "</tr>";

        
    echo "<tr>";
    echo "<td class='none'><b>info</b></td>";
    echo "<td class='none'>";

    echo "<textarea cols='30' rows='7' name='info'></textarea>";
    
    echo "</td>";
    echo "</tr>";

        
    echo "<tr>";
    echo "<td class='none'><input type='submit' name='toevoegen' value='Voeg record toe'><br>";
    echo "<a href='test.php'>Terug</a></td>";
    echo "</tr>";

    echo "</table>";
    echo "</form>";

    }

}
else if($functie == "w"){

    $wijzig_id = $_GET['fid'];

    if($_POST['wijzigen']){

        $type = $HTTP_POST_VARS['type'];
        $naam = $HTTP_POST_VARS['naam'];
        $url = $HTTP_POST_VARS['url'];
        $info = $HTTP_POST_VARS['info'];
        
        $wijzigen = mysql_query("UPDATE domeininfo SET

        type = '$type' , naam = '$naam' , url = '$url' , info = '$info'
         WHERE id = '$wijzig_id' LIMIT 1"
) or die(mysql_error());

        echo "Record is gewijzigd.<br>";
            echo "<script language='JavaScript'> document.location = 'test.php'; </script>";
        
    }
else {

    echo "<hr>";
    echo "<b>Wijzig een record</b>:";
    echo "<hr>";

    $record_select = mysql_query("SELECT * FROM domeininfo WHERE id = '$wijzig_id' LIMIT 1");
    while($row = mysql_fetch_array($record_select)){

        echo "<form method='post' target='_self'>";
        echo "<table>";

            
        echo "<tr>";
        echo "<td class='none'><b>type</b></td>";
        echo "<td class='none'>";


        echo "<input type='text' name='type' value='".$row['type']."'>";
        
        echo "</td>";
        echo "</tr>";

            
        echo "<tr>";
        echo "<td class='none'><b>naam</b></td>";
        echo "<td class='none'>";


        echo "<input type='text' name='naam' value='".$row['naam']."'>";
        
        echo "</td>";
        echo "</tr>";

            
        echo "<tr>";
        echo "<td class='none'><b>url</b></td>";
        echo "<td class='none'>";


        echo "<input type='text' name='url' value='".$row['url']."'>";
        
        echo "</td>";
        echo "</tr>";

            
        echo "<tr>";
        echo "<td class='none'><b>info</b></td>";
        echo "<td class='none'>";


        echo "<textarea name='info' cols='30' rows='7'>".$row['info']."</textarea>";
        
        echo "</td>";
        echo "</tr>";

            
        echo "<tr>";
        echo "<td class='none'><input type='submit' name='wijzigen' value='Wijzig dit record'></td>";
        echo "</tr>";

        echo "</table>";
        echo "</form>";

    }

    }

}


?>


</td></tr></table>

</body>
</html>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.