Kan niet connecten?
Ik ben dus bezig met een systeem waarbij je je inhoud kan bewerken etc.
Maar ben dus al een heletijd bezig aan de bewerk pagina, maar op de een of andere manier wilt deze niet connecten met de database misschien dat 1 van jullie de fout ziet:
( stuur alles mee omdat het misschien een fout is ergens anders in dan php :P )
Code (php)
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
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
<?
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("UPDATE tabel SET titel = '".$_POST['titel']."', text = '".$_POST['text']."', datum = '".$_POST['datum']."' WHERE id = '".$_POST['id']."'") or die(mysql_error());
echo 'berichtje geupdate';
}
}
$result = mysql_query("SELECT * FROM tabel WHERE id = '".$_GET['id']."' LIMIT 1");
while($row = mysql_fetch_array($result)) {
?>
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/example.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<h2>Bericht Wijzigen</h2>
<form method="post" action="">
<input type="hidden" name="id" value="<? echo $_GET['id']; ?>">
<p>
Datum:<br />
<input type="text" name="datum" value="<? echo $row['datum']; ?>">
<br />
Berichttitel:<br />
<input type="text" name="titel" value="<? echo $row['titel']; ?>">
<br>
Bericht:
<br>
<textarea name="text" width="600px" cols="100" rows="10" value="">value="<? echo $row['text']; ?>"</textarea>
<br>
<input type="submit" name="submit" value="Verzenden" />
</p>
</form>
<?
}
?>
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("UPDATE tabel SET titel = '".$_POST['titel']."', text = '".$_POST['text']."', datum = '".$_POST['datum']."' WHERE id = '".$_POST['id']."'") or die(mysql_error());
echo 'berichtje geupdate';
}
}
$result = mysql_query("SELECT * FROM tabel WHERE id = '".$_GET['id']."' LIMIT 1");
while($row = mysql_fetch_array($result)) {
?>
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/example.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<h2>Bericht Wijzigen</h2>
<form method="post" action="">
<input type="hidden" name="id" value="<? echo $_GET['id']; ?>">
<p>
Datum:<br />
<input type="text" name="datum" value="<? echo $row['datum']; ?>">
<br />
Berichttitel:<br />
<input type="text" name="titel" value="<? echo $row['titel']; ?>">
<br>
Bericht:
<br>
<textarea name="text" width="600px" cols="100" rows="10" value="">value="<? echo $row['text']; ?>"</textarea>
<br>
<input type="submit" name="submit" value="Verzenden" />
</p>
</form>
<?
}
?>
Alvast heel erg bedankt!
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
<?PHP
# Dit bovenaan je pagina
ini_set ('display_errors', 1);
error_reporting(E_ALL);
?>
# Dit bovenaan je pagina
ini_set ('display_errors', 1);
error_reporting(E_ALL);
?>
Verder is SQL Injection mogelijk.
Je fouten afhandeling mag ook nog wel wat beter.
Verder krijg je geen foutmelding?
Warning: mysql_query() [function.mysql-query]: Access denied for user 'apache'@'localhost' (using password: NO) in /home/ais179/domains/kps-designs.nl/public_html/testsite/admin/homebewerk.php on line 24
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/ais179/domains/kps-designs.nl/public_html/testsite/admin/homebewerk.php on line 24
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ais179/domains/kps-designs.nl/public_html/testsite/admin/homebewerk.php on line 26
Sorry dat ik geen fouten toonde ;)
Dit zijn ze ik ga nu even die code erin zetten ;)
Wat houdt:
Notice: Undefined index: submit in /home/ais179/domains/kps-designs.nl/public_html/testsite/admin/homebewerk.php on line 12
Precies in?
Gewijzigd op 01/01/1970 01:00:00 door Mike
De database connectie? Die heb je wel? Staat die in de config? En klopt deze?
Voor zover ik weet klopt deze, hij werkt ook gewoon op de index dus bij bewerk zou hij het ook moeten doen.
Volledige code:
Code (php)
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
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
<?php
include('header.php');
include 'config.php';
?>
<?php
include 'config.php';
if(!$login->get_login_info()) {
// Niet ingelogd, login deel weergeven
include('login.inc.php');
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/default.css" media="screen,projection" type="text/css" />
<link rel="stylesheet" href="css/lightbox.css" media="screen,projection" type="text/css" />
<script type="text/javascript" src="scripts/prototype.js"></script>
<script type="text/javascript" src="scripts/lightbox.js"></script>
</head>
<body>
<div class="omhulsel">
<div class="logo"><center><img src="plaatjes/logo.png" alt="logo" width="190" height="145" /></center>
</div>
<div class="plaatje">
<img src="fotos/1.jpg" width="790" height="150" alt="foto" /></div>
<div class="menu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Administratie Menu</h2>
</li>
<li><a href="#">Home</a></li>
<li><a href="#">Uploadsysteem</a></li>
<li><a href="#">Geuploade Plaatjes</a></li>
<li><a href="#">Flickr</a></li>
<ul>
<li><a href="#">Klanteninformatie</a></li>
</ul>
<li><a href="index.php?actie=uitloggen">Uitloggen</a></li>
</ul>
</div>
<div class="content">
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/example.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<?
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("INSERT INTO tabel (titel, text, datum) VALUES ('".$_POST['titel']."','".$_POST['text']."','".$_POST['datum']."')") or die(mysql_error());
echo 'Bericht toegevoegd';
}
}
?>
<p><a href="hometoevoegen.php" class="lbOn">Bericht Toevoegen </a></p>
<p> </p>
<?php
include 'config.php';
if($_POST['verwijder']){
mysql_query("DELETE FROM tabel WHERE id = '".$_POST['id_nummer']."'");
echo 'Het Bericht is succesvol verwijderd!<br><br><br>';
} elseif($_GET['action']=="verwijder"){
echo 'Je staat op het punt om een berichtje te verwijderen.';
echo '<form method="POST" action="">
<input type="hidden" name="id_nummer" value="'.$_GET['id'].'">
<input type="submit" value="Verwijder bericht" name="verwijder">
</form><br><br>';
}
$result = mysql_query ('SELECT * FROM tabel ORDER BY id DESC ') or die ('Error: '.mysql_error ());
while($row = mysql_fetch_array($result)) {
echo '
<a href="homebewerk.php?id='.$row['id'].'" class="lbOn"><img border="0" src="images/bewerk.gif" widtd="24" height="21"></a><a href="index.php?action=verwijder&id='.$row['id'].'"><img border="0" src="images/verwijder.gif" widtd="23" height="24"></a>
<h2 class="datum">'.$row['datum'].'</h2>
<h2>'.$row['titel'].'</h2>
<p><br />'.$row['text'].' </p><br />
<br />
';
}
?>
</div>
<div class="lmenu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Algemeen</h2>
</li>
<li><a href="index.php">Home</a></li>
<li><a href="downloads.php">Downloads</a></li>
<li><a href="overons.php">Over Ons</a></li>
<li><a href="apparatuur.php">Apparatuur</a></li>
<li><a href="werkwijze.php">Werkwijze</a></li>
</ul>
</div>
<div class="lmenu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Diensten & Tarieven</h2>
</li>
<li><a href="portfolio.php">Portfolio</a></li>
<li><a href="professionelewebsite.php">Professionele Website</a></li>
<li><a href="cms-systeem.php">CMS-Systeem</a></li>
<li><a href="huisstijl.php">Huisstijl & Drukwerk</a></li>
<li><a href="fotografie.php">Fotografie</a></li>
</ul>
</div>
<div class="lmenu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Communicatie</h2>
</li>
<li><a href="agenda.php">Agenda</a></li>
<li><a href="partners.php">Partners</a></li>
</ul>
</div>
</div>
</body>
</html>
<?php
}
?>
include('header.php');
include 'config.php';
?>
<?php
include 'config.php';
if(!$login->get_login_info()) {
// Niet ingelogd, login deel weergeven
include('login.inc.php');
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/default.css" media="screen,projection" type="text/css" />
<link rel="stylesheet" href="css/lightbox.css" media="screen,projection" type="text/css" />
<script type="text/javascript" src="scripts/prototype.js"></script>
<script type="text/javascript" src="scripts/lightbox.js"></script>
</head>
<body>
<div class="omhulsel">
<div class="logo"><center><img src="plaatjes/logo.png" alt="logo" width="190" height="145" /></center>
</div>
<div class="plaatje">
<img src="fotos/1.jpg" width="790" height="150" alt="foto" /></div>
<div class="menu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Administratie Menu</h2>
</li>
<li><a href="#">Home</a></li>
<li><a href="#">Uploadsysteem</a></li>
<li><a href="#">Geuploade Plaatjes</a></li>
<li><a href="#">Flickr</a></li>
<ul>
<li><a href="#">Klanteninformatie</a></li>
</ul>
<li><a href="index.php?actie=uitloggen">Uitloggen</a></li>
</ul>
</div>
<div class="content">
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/example.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<?
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("INSERT INTO tabel (titel, text, datum) VALUES ('".$_POST['titel']."','".$_POST['text']."','".$_POST['datum']."')") or die(mysql_error());
echo 'Bericht toegevoegd';
}
}
?>
<p><a href="hometoevoegen.php" class="lbOn">Bericht Toevoegen </a></p>
<p> </p>
<?php
include 'config.php';
if($_POST['verwijder']){
mysql_query("DELETE FROM tabel WHERE id = '".$_POST['id_nummer']."'");
echo 'Het Bericht is succesvol verwijderd!<br><br><br>';
} elseif($_GET['action']=="verwijder"){
echo 'Je staat op het punt om een berichtje te verwijderen.';
echo '<form method="POST" action="">
<input type="hidden" name="id_nummer" value="'.$_GET['id'].'">
<input type="submit" value="Verwijder bericht" name="verwijder">
</form><br><br>';
}
$result = mysql_query ('SELECT * FROM tabel ORDER BY id DESC ') or die ('Error: '.mysql_error ());
while($row = mysql_fetch_array($result)) {
echo '
<a href="homebewerk.php?id='.$row['id'].'" class="lbOn"><img border="0" src="images/bewerk.gif" widtd="24" height="21"></a><a href="index.php?action=verwijder&id='.$row['id'].'"><img border="0" src="images/verwijder.gif" widtd="23" height="24"></a>
<h2 class="datum">'.$row['datum'].'</h2>
<h2>'.$row['titel'].'</h2>
<p><br />'.$row['text'].' </p><br />
<br />
';
}
?>
</div>
<div class="lmenu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Algemeen</h2>
</li>
<li><a href="index.php">Home</a></li>
<li><a href="downloads.php">Downloads</a></li>
<li><a href="overons.php">Over Ons</a></li>
<li><a href="apparatuur.php">Apparatuur</a></li>
<li><a href="werkwijze.php">Werkwijze</a></li>
</ul>
</div>
<div class="lmenu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Diensten & Tarieven</h2>
</li>
<li><a href="portfolio.php">Portfolio</a></li>
<li><a href="professionelewebsite.php">Professionele Website</a></li>
<li><a href="cms-systeem.php">CMS-Systeem</a></li>
<li><a href="huisstijl.php">Huisstijl & Drukwerk</a></li>
<li><a href="fotografie.php">Fotografie</a></li>
</ul>
</div>
<div class="lmenu">
<ul>
<li>
<h2> <img src="plaatjes/puntjemenu.png" width="20" height="10" alt="menu" />Communicatie</h2>
</li>
<li><a href="agenda.php">Agenda</a></li>
<li><a href="partners.php">Partners</a></li>
</ul>
</div>
</div>
</body>
</html>
<?php
}
?>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("INSERT INTO tabel (titel, text, datum) VALUES ('".$_POST['titel']."','".$_POST['text']."','".$_POST['datum']."')") or die(mysql_error());
echo 'Bericht toegevoegd';
}
}
?>
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("INSERT INTO tabel (titel, text, datum) VALUES ('".$_POST['titel']."','".$_POST['text']."','".$_POST['datum']."')") or die(mysql_error());
echo 'Bericht toegevoegd';
}
}
?>
dit staat er en het moet lama zeggen samenwerken (via lightbox dus 2 aparte pagina's )met:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("UPDATE tabel SET titel = '".$_POST['titel']."', text = '".$_POST['text']."', datum = '".$_POST['datum']."' WHERE id = '".$_POST['id']."'") or die(mysql_error());
echo 'berichtje geupdate';
}
}
$result = mysql_query("SELECT * FROM tabel WHERE id = '".$_GET['id']."' LIMIT 1");
while($row = mysql_fetch_array($result)) {
?>
include 'config.php';
if($_POST['submit']){
if($_POST['titel']==""||$_POST['text']==""||$_POST['datum']==""){
echo 'Er is iets niet ingevuld!';
} else {
mysql_query("UPDATE tabel SET titel = '".$_POST['titel']."', text = '".$_POST['text']."', datum = '".$_POST['datum']."' WHERE id = '".$_POST['id']."'") or die(mysql_error());
echo 'berichtje geupdate';
}
}
$result = mysql_query("SELECT * FROM tabel WHERE id = '".$_GET['id']."' LIMIT 1");
while($row = mysql_fetch_array($result)) {
?>
na veel gekut en geklooi is het me dan eindelijk gelukt!
Is dit een geldige code?
Wesley schreef op 18.12.2009 18:07:
include 'config.php';
Is dit een geldige code?
Is dit een geldige code?
Ja