Versio

Formulier verzend automatisch

Overzicht Reageren

Remco van Lent

Remco van Lent

03/02/2007 15:10:00
Quote Anchor link
Hallo,
als ik mijn formulier open verzend hij automatisch (als ik op de url kom). Maar als je op verzenden klikt verzend hij niet.
Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<?php

echo "<html><head>";
echo "<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">";
echo "</head><body>";
if(isset($_POST['submit'])) {
exit;  
}
  
 
$bericht = "Afzender : ".stripslashes($_POST['habbonaam'])."
"
;
$bericht = "";
$bericht .= "Lengte ban : ".stripslashes($_POST['lengteban'])."
"
;  
$bericht = "";
$bericht .= "Habbonaam : ".stripslashes($_POST['habbonaam'])."

"
;

$bericht .= "Lengte ban : ".stripslashes($_POST['lengteban'])."

"
;

$bericht .= "Computerban : ".stripslashes($_POST['checkbox'])."

"
;

$bericht .= "Ip ban : ".stripslashes($_POST['checkbox1'])."

"
;

$bericht .= "Door wie? : ".stripslashes($_POST['habbonaam0'])."

"
;

$bericht .= "Reden? : ".stripslashes($_POST['bericht'])."

"
;

$bericht .= "IP : ".$_SERVER['REMOTE_ADDR']."
"
;

$bericht .= "Host : ".@gethostbyaddr($_SERVER['REMOTE_ADDR'])."
"
;
 
$bericht .= "Browser : ".$_SERVER['HTTP_USER_AGENT']."
"
;

$bericht .= "Onderwerp : ".stripslashes($_POST['onderwerp'])."
"
;

$bericht .= "Wat wil je vragen : ".stripslashes($_POST['layout']).".";
$headers = "From: ".$_POST['naam']." <".$_POST['email'].">\n\r";
$headers .= "Return-Path: hotel? (Habbo.cc) <noreplay@habbo.cc>\r\n"; //spreekt voor zich
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $webmaster = "info@habbo.cc"; //waar moet de e-mail naartoe worden verzonden

mail($webmaster, stripslashes($_POST['onderwerp']), $bericht, $headers);  
?>
  
<form id="contact" name="contact" method="post">
<table width="100%" border='0' cellpadding="2" cellspacing="0">
  <tr>
      <td colspan="2" class="contact rijkleur">Heb je iemand verbannen, Meld dat hier</td>
  </tr>
  <tr>
      <td width="20%" class="contact">HabboNaam:</td>
      <td width="80%" class="contact"><input type="text" name="naam" id="naam" size="60" maxlength="35" /></td>
  </tr>
  <tr>

                            <td width="99">Lengte ban: </td>
                            <td align="left">
                            <select size="1" name="lengteban">
                            <option>2 uur</option>
                            <option>4 uur</option>
                            <option>12 uur</option>
                            <option>24 uur</option>
                            <option>2 dagen</option>
                            <option>3 dagen</option>
                            <option>7 dagen</option>
                            <option>14 dagen</option>
                            <option>21 dagen</option>
                            <option>30 dagen</option>
                            <option>60 dagen</option>
                            <option>365 dagen</option>
                            <option>730 dagen</option>
                            <option>4167 dagen</option>
                            </select></td>
                        </tr>
                        <tr>
                            <td width="99">Computer ban?</td>
                            <td align="left">
                            <input type="checkbox" name="C2" value="ON"></td>
                        </tr>
                        <tr>
                            <td align="right" width="99">Ip ban?:</td>
                            <td align="left">
                            <input type="checkbox" name="C1" value="ON"></td>
                        </tr>
                        <tr>
                            <td align="right" width="99">Door wie?</td>
                            <td align="left">
                            <input name="HabboNaam0" type="text" size="21"></td>
                        </tr>
                <tr>
                            <td align="right" width="99">Reden ban:</td><br>
    <td align="left">
                    <textarea name="bericht" rows="10" cols="50"></textarea><br>
                </tr>

  <tr>
    <td class="contact rijkleur">&nbsp;</td>
    <td class="contact rijkleur"><input type="submit" name="submit" id="submit" value="Verzend" /></td>
  </tr>
</table>
</form>
</body>
</html>
 
PHP hulp

PHP hulp

24/05/2012 17:07:25
Gesponsorde koppelingen:
 
- SanThe -

- SanThe -

03/02/2007 15:38:00
Quote Anchor link
Logisch.

Want als je op submit klikt stopt het script blijkbaar, en anders niet.

if(isset($_POST['submit'])) {
exit;
}
 



Overzicht Reageren

Get Adobe Flash player