mijn script om aan te passen werkt niet
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?php
include ('config.php');
if ($_POST['Veranderen']) {
if (!$error) {
$query = "UPDATE promoties SET omschrijving='$HTTP_POST_VARS[$omschrijving]', datum1='$HTTP_POST_VARS[$datum1]',
datum2='$HTTP_POST_VARS[$datum2]', document='$HTTP_POST_VARS[$document]' WHERE id = $HTTP_GET_VARS[id]";
mysql_query($query) or die (mysql_error());
?>
include ('config.php');
if ($_POST['Veranderen']) {
if (!$error) {
$query = "UPDATE promoties SET omschrijving='$HTTP_POST_VARS[$omschrijving]', datum1='$HTTP_POST_VARS[$datum1]',
datum2='$HTTP_POST_VARS[$datum2]', document='$HTTP_POST_VARS[$document]' WHERE id = $HTTP_GET_VARS[id]";
mysql_query($query) or die (mysql_error());
?>
<div align="center">
<table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Promotie
veranderen: </b></font></td>
</tr>
<tr bgcolor="#999999">
<td colspan="2" height="68" bgcolor="#CCCCCC">
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">De promotie is succesvol veranderd<br>
</font>
<hr color="black">
<font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[ Terug
naar <a href="admin.php">admin pagina</a> ]</font></div>
</td>
</tr>
</table>
</div>
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
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
<?php
} elseif ($error) {
echo"
<div align=\"center\"><table width=\"50%\" border=\"1\"
cellspacing=\"0\" cellpadding=\"2\">
<tr bordercolor=\"#000000\">
<td bordercolor=\"#000000\" bgcolor=\"#CCCCCC\" height=\"36\">
<div align=\"center\"><font color=\"#000000\" face=\"Verdana,
Arial, Helvetica, sans-serif\" size=\"-1\"><div align=center>
<font color=black size=-1 face=verdana><b>$error</b><br>
</font></div></font></div>
<form method=\"post\" action=\"javascript:history.go(-1)\">
<div align=center><input type=\"submit\" name=\"Terug\"
value=\"Terug\"></div>
</form></td></tr></table></div>
";
}
} else {
$query = "SELECT * FROM promoties WHERE id = $HTTP_GET_VARS[id]";
$resultaat = mysql_query($query) or die (mysql_error());
while ($rij = mysql_fetch_object($resultaat))
{
$id = ($rij->id);
$omschrijving = ($rij->omschrijving);
$datum1 = ($rij->datum1);
$datum2 = ($rij->datum2);
$document = ($rij->document);
?>
} elseif ($error) {
echo"
<div align=\"center\"><table width=\"50%\" border=\"1\"
cellspacing=\"0\" cellpadding=\"2\">
<tr bordercolor=\"#000000\">
<td bordercolor=\"#000000\" bgcolor=\"#CCCCCC\" height=\"36\">
<div align=\"center\"><font color=\"#000000\" face=\"Verdana,
Arial, Helvetica, sans-serif\" size=\"-1\"><div align=center>
<font color=black size=-1 face=verdana><b>$error</b><br>
</font></div></font></div>
<form method=\"post\" action=\"javascript:history.go(-1)\">
<div align=center><input type=\"submit\" name=\"Terug\"
value=\"Terug\"></div>
</form></td></tr></table></div>
";
}
} else {
$query = "SELECT * FROM promoties WHERE id = $HTTP_GET_VARS[id]";
$resultaat = mysql_query($query) or die (mysql_error());
while ($rij = mysql_fetch_object($resultaat))
{
$id = ($rij->id);
$omschrijving = ($rij->omschrijving);
$datum1 = ($rij->datum1);
$datum2 = ($rij->datum2);
$document = ($rij->document);
?>
<form action="" method="post">
<div align="center">
<table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Promotie
veranderen: </b></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica,
sans-serif">Omschrijving: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="omschrijving" size="30" value="">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica,
sans-serif">Datum van: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="datum1" size="30" value="">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica,
sans-serif">Datum tot: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="datum2" size="30" value="">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica,
sans-serif">Document: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="document" size="30" value="">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2"> </td>
</tr>
<tr bgcolor="#999999">
<td colspan="2" height="20">
<div align="center">
<input type="submit" value="Verander nieuws" name="Veranderen">
<input type="button" value="Terug naar admin"
onClick="window.location='admin.php' " name="button">
</div>
</td>
</tr>
</table>
</div>
</form>
kan er mij iemand helpen want zou dit vandaag willen afwerken en doen werken
Vermeld de error, helpt misschien..
staat toch bovenaan --> er verschijnt gelukt maar alle data in van de promotie is terug blanco op mijn admin.php
met wat voorn database werk je?
met mysql ....srry, maar klinkt als een probleem in je database...