hoe het kan dat je SUBMIT niet werkt...
wat zie ik over het hooft.
Quote:
<form action="" method="POST" >
Door wie: <select id="wie" name="door">
</select>
<select name='met'>
</select>
<div id="Datum">Datum: <input name="datum" type="date" /></div>
<div id="tijd">Tijd: <input name="tijd" type="time" /></div>
<div id="Afspraak">Afspraak: <input name="afspraak" type="text" /></div>
<input type="submit" value="Maak afspraak" name="nieuwe_afspraak">
</form>
Code (php)
1
2
3
4
2
3
4
<?php
$select_users = mysql_query ("SELECT * FROM tbl_users");
$select_users2 = mysql_query("SELECT * FROM werknemers");
?>
$select_users = mysql_query ("SELECT * FROM tbl_users");
$select_users2 = mysql_query("SELECT * FROM werknemers");
?>
<form action="" method="POST" >
Door wie: <select id="wie" name="door">
Code (php)
1
2
3
4
5
2
3
4
5
<?php
while ($select_persoon = mysql_fetch_assoc($select_users)){
echo '<option value="'.$select_persoon['id'].'">'.$select_persoon['name'].'</option>';
}
?>
while ($select_persoon = mysql_fetch_assoc($select_users)){
echo '<option value="'.$select_persoon['id'].'">'.$select_persoon['name'].'</option>';
}
?>
</select>
<select name='met'>
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?php
while ($row2 = mysql_fetch_array($select_users2)) {
echo '<option value="'.$row2['ID'].'">'.$row2['Naam'].'</option>';
}
?>
while ($row2 = mysql_fetch_array($select_users2)) {
echo '<option value="'.$row2['ID'].'">'.$row2['Naam'].'</option>';
}
?>
</select>
<div id="Datum">Datum: <input name="datum" type="date" /></div>
<div id="tijd">Tijd: <input name="tijd" type="time" /></div>
<div id="Afspraak">Afspraak: <input name="afspraak" type="text" /></div>
<input type="submit" value="Maak afspraak" name="nieuwe_afspraak">
</form>
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
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
<?php
if (isset($_POST['nieuwe_afspraak'])){
echo "De SUBMIT werkt niet, hoe kan dat?";
$sql_insert_user = "INSERT INTO archief2 (id, wie, naam, datum, tijd, afspraak) VALUES (
'',
'".mysql_real_escape_string($_POST['door'])."',
'".mysql_real_escape_string($_POST['met'])."',
'".mysql_real_escape_string($_POST['datum'])."',
'".mysql_real_escape_string($_POST['tijd'])."',
'".mysql_real_escape_string($_POST['afspraak'])."'
)
";
echo "Query uitgevoerd";
echo "<script>window.location = 'afspraak.php';</script>";
$result = mysql_query("SELECT * FROM WIE");
$result = mysql_query("SELECT * FROM ASPRAKEN ORDER BY WIE");
ob_start();
echo "<table border='1'>";
echo "<th>wie</th>";
echo "<th>Naam</th>";
echo "<th>Datum</th>";
echo "<th>tijd</th>";
echo "<th>Afspraak</th>";
while ($row = mysql_fetch_array($result)) {
echo "<tr><td>".$row['wie']."</td>";
echo "<td>".$row['Naam']."</td>";
echo "<td>".$row['Datum']."</td>";
echo "<td>".$row['tijd']."</td>";
echo "<td>".$row['Afspraak']."</td>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
}
echo "</table>";
$bericht = ob_get_contents();
ob_end_clean();
mail('[email protected],[email protected],[email protected]', 'Combigoods - Afspraken', $bericht, $headers);
$result = mysql_query("SELECT * FROM aspraken");
while ($row = mysql_fetch_array($result)) {
mysql_query("INSERT IGNORE INTO archief2 SELECT * FROM aspraken");
mysql_query("DELETE FROM ASPRAKEN");
}
}
?>
if (isset($_POST['nieuwe_afspraak'])){
echo "De SUBMIT werkt niet, hoe kan dat?";
$sql_insert_user = "INSERT INTO archief2 (id, wie, naam, datum, tijd, afspraak) VALUES (
'',
'".mysql_real_escape_string($_POST['door'])."',
'".mysql_real_escape_string($_POST['met'])."',
'".mysql_real_escape_string($_POST['datum'])."',
'".mysql_real_escape_string($_POST['tijd'])."',
'".mysql_real_escape_string($_POST['afspraak'])."'
)
";
echo "Query uitgevoerd";
echo "<script>window.location = 'afspraak.php';</script>";
$result = mysql_query("SELECT * FROM WIE");
$result = mysql_query("SELECT * FROM ASPRAKEN ORDER BY WIE");
ob_start();
echo "<table border='1'>";
echo "<th>wie</th>";
echo "<th>Naam</th>";
echo "<th>Datum</th>";
echo "<th>tijd</th>";
echo "<th>Afspraak</th>";
while ($row = mysql_fetch_array($result)) {
echo "<tr><td>".$row['wie']."</td>";
echo "<td>".$row['Naam']."</td>";
echo "<td>".$row['Datum']."</td>";
echo "<td>".$row['tijd']."</td>";
echo "<td>".$row['Afspraak']."</td>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
}
echo "</table>";
$bericht = ob_get_contents();
ob_end_clean();
mail('[email protected],[email protected],[email protected]', 'Combigoods - Afspraken', $bericht, $headers);
$result = mysql_query("SELECT * FROM aspraken");
while ($row = mysql_fetch_array($result)) {
mysql_query("INSERT IGNORE INTO archief2 SELECT * FROM aspraken");
mysql_query("DELETE FROM ASPRAKEN");
}
}
?>
Er zijn nog geen reacties op dit bericht.