e-mail script probleempje
ik zou dus graag een scriptje hebben waar je ene verzender,ontvanger,onderwerp en tekst kunt invoegen dus probeerde ik er 1 aan te passen maar het lukte niet wat is de fout ? help aub
<table width=100% height=100%>
<form action="http://www.google.be" method="POST">
<table>
<tr>
<td>Je e-mail Address:</td>
<td><input type="text" name="address"></td></tr>
<tr>
<td>Subject</td>
<td><input type="text" name="subject"></td></tr>
<td>Sender</td>
<td><input type="text" name="sender"></td></tr>
<tr><td colspan=2><textarea cols=80 rows=12 name="body" class="text"></textarea></td></tr>
<tr><td> </td><td><input type="submit" value="send"></td></tr>
</form>
</table>
<table width=100%>
</table>
<table width=100%>
<tr><td>Bericht verzonden!</td></tr>
</table>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
if (isset($_POST['address']) && isset($_POST['subject']) && isset($_POST['body']) && isset($_POST['sender'])) {
if ($_POST['address'] == "" || $_POST['body'] == "") {
print_error();
print_form();
} else {
mail('sender', $_POST['subject'], $_POST['body'] . "\n" . $_POST['address']);
print_sent();
}
} else {
print_form();
}
function print_form() {
?>
if (isset($_POST['address']) && isset($_POST['subject']) && isset($_POST['body']) && isset($_POST['sender'])) {
if ($_POST['address'] == "" || $_POST['body'] == "") {
print_error();
print_form();
} else {
mail('sender', $_POST['subject'], $_POST['body'] . "\n" . $_POST['address']);
print_sent();
}
} else {
print_form();
}
function print_form() {
?>
<table width=100% height=100%>
<form action="http://www.google.be" method="POST">
<table>
<tr>
<td>Je e-mail Address:</td>
<td><input type="text" name="address"></td></tr>
<tr>
<td>Subject</td>
<td><input type="text" name="subject"></td></tr>
<td>Sender</td>
<td><input type="text" name="sender"></td></tr>
<tr><td colspan=2><textarea cols=80 rows=12 name="body" class="text"></textarea></td></tr>
<tr><td> </td><td><input type="submit" value="send"></td></tr>
</form>
</table>
<table width=100%>
</table>
<table width=100%>
<tr><td>Bericht verzonden!</td></tr>
</table>