| 1 |
<html> |
| 2 |
<head> |
| 3 |
<title>Embperl Example - Input / Confirmation - Form</title> |
| 4 |
</head> |
| 5 |
<body background="../images/jazzbkgd.gif"> |
| 6 |
|
| 7 |
<h1>Embperl Examples - Input / Confirmation - Form</h1> |
| 8 |
|
| 9 |
<b>Please make sure you enter a valid email address in the |
| 10 |
source before testing the mail function</b> |
| 11 |
|
| 12 |
[- |
| 13 |
$MailTo = '[email protected]' ; |
| 14 |
|
| 15 |
@errors = () ; |
| 16 |
if (defined($fdat{check}) || defined($fdat{send})) |
| 17 |
{ |
| 18 |
push @errors, "**Please enter your name" if (!$fdat{name}) ; |
| 19 |
push @errors, "**Please enter your e-mail address" if (!$fdat{email}) ; |
| 20 |
} |
| 21 |
-] |
| 22 |
|
| 23 |
[$if (defined($fdat{check}) and $#errors == -1)$] |
| 24 |
[- delete $fdat{input} ; delete $fdat{check} ; delete $fdat{send} -] |
| 25 |
|
| 26 |
<hr><h3> You have entered the following data:</h3> |
| 27 |
<table> |
| 28 |
<tr><td><b>Name</b></td><td>[+$fdat{name}+]</td></tr> |
| 29 |
<tr><td><b>E-Mail</b></td><td>[+$fdat{email}+]</td></tr> |
| 30 |
<tr><td><b>Message</b></td><td>[+$fdat{msg}+]</td></tr> |
| 31 |
<tr><td align="center" colspan="2"> |
| 32 |
<form action="input.htm" method="GET"> |
| 33 |
<input type="submit" name="send" value="Send to [+ $MailTo +]"> |
| 34 |
<input type="submit" name="input" value="Change your data"> |
| 35 |
[$hidden$] |
| 36 |
</form> |
| 37 |
</td></tr> |
| 38 |
</table> |
| 39 |
|
| 40 |
[$elsif defined($fdat{send}) and $#errors == -1$] |
| 41 |
|
| 42 |
[- MailFormTo ($MailTo,'Formdata','email') -] |
| 43 |
<hr><h3>Your input has been sent</h3> |
| 44 |
|
| 45 |
[$else$] |
| 46 |
|
| 47 |
<hr><h3>Please enter your data</h3> |
| 48 |
|
| 49 |
<form action="input.htm" method="GET"> |
| 50 |
<table> |
| 51 |
[$if $#errors != -1 $] |
| 52 |
<tr><td colspan="2"> |
| 53 |
<table> |
| 54 |
<tr><td>[+$errors[$row]+]</td></tr> |
| 55 |
</table> |
| 56 |
</td></tr> |
| 57 |
[$endif$] |
| 58 |
<tr><td><b>Name</b></td> <td><input type="text" name="name"></td></tr> |
| 59 |
<tr><td><b>E-Mail</b></td> <td><input type="text" name="email"></td></tr> |
| 60 |
<tr><td><b>Message</b></td> <td><input type="text" name="msg"></td></tr> |
| 61 |
<tr><td colspan=2><input type="submit" name="check" value="Send"></td></tr> |
| 62 |
</table> |
| 63 |
</form> |
| 64 |
|
| 65 |
[$endif$] |
| 66 |
|
| 67 |
<p><hr> |
| 68 |
|
| 69 |
<small>HTML::Embperl (c) 1997-1998 G.Richter</small> |
| 70 |
|
| 71 |
</body> |
| 72 |
</html> |