Toon posts:

Waar cgi-script halen + hulp

Pagina: 1
Acties:
  • 195 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Ik wil een aanmeld site maken via een cgi-script zodat hij via een server naar de e-mail gaat....
Welke provider of hoster (of hoe dat heet) is het beste? En wie kan mij helpen om het in html goed te zetten

Verwijderd

Op woensdag 10 oktober 2001 21:27 schreef LifeStyLe het volgende:
Ik wil een aanmeld site maken via een cgi-script zodat hij via een server naar de e-mail gaat....
Welke provider of hoster (of hoe dat heet) is het beste? En wie kan mij helpen om het in html goed te zetten
Niet om het een of ander, maar PHP is daar toch zeker wel duizend keer beter voor hoor :).

Hosting: f2s.com

Verwijderd

Topicstarter
Ja maar dat moet je ook maar net ff kunnen en dat kan ik niet laat staan een goed script in html schrijven maar het moet vandaag af

Verwijderd

Topicstarter
Dit heb ik al in html:

<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Aanmelden</title>
</head>

<body bgcolor="#FFFFFF">

<p>[img]"aanmelden.jpg"[/img]</p>

<p> </p>

<form method="POST" name="wissen">
<p><em><strong>Naam: </strong></em><input type="text"
size="20" name="T8"></p>
<p><em><strong>Adres: </strong></em><input type="text"
size="20" name="T9"></p>
<p><em><strong>Telefoonnummer:</strong></em><input
type="text" size="20" name="T7"></p>
<p><em><strong>Betaalt via:</strong></em><select
name="Betalen via" size="1">
<option>Bankrekening</option>
<option>XXX XXX</option>
<option>XXX XXX</option>
<option>XXX XXX</option>
<option>XXX XXX</option>
<option>XXX XXX</option>
<option>XXX XXX</option>
</select></p>
<p><font color="#000000"><em><b>Bankrekening nummer:
586037349 ABN Amro Tubbergen</b></em></font></p>
<p><font color="#000000"><em><b>Op naam van XXX XXX</b></em></font></p>
<p><font color="#000000"><em><b>Zet bij de omschrijving je
naam/nickname en achternaam.</b></em></font></p>
<p><input type="submit" name="B1" value="Registreren"> <input
type="reset" name="B2" value="Alles wissen"></p>
</form>
</body>
</html>

[ Voor 4% gewijzigd door RobIII op 06-05-2025 10:12 ]


  • Thijsmans
  • Registratie: Juli 2001
  • Laatst online: 14:39

Thijsmans

⭐⭐⭐⭐⭐ (5/5)

ik zou ff die twee meta tags eruit raggen.
:7

ps: waar wil je naartoe?

Privacy-adepten vinden op AVGtekst.nl de Nederlandse AVG-tekst voorzien van uitspraken en besluiten.


Verwijderd

Een Form mail scrippie

als je ene beginner bent heb je dat waarschijnlijk niet vandaag af...

anyway zoek naar 'mail form scripts' op google ofzo

Verwijderd

Je kunt goed zoeken op, hotscripts.com. (beetje scriptrequest ruik ik, maar iedereen moet ergens beginnen :) )
Een gratis hoster weet ik zo niet.
Het cgi script waar ik het mee leerde was ook tegelijk te gebruiken voor flash.

Dit is hem, (ook van hotscripts, maar weet niet zeker)
code:
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
#!/usr/bin/perl
#
############################################################################
#   EZ Form Mailer      Version 1.1
#
#   1.1 Changed get_date to be Y2K compliant.
#
#   Copyright 1997, 1999 3rd Coast Technologies, LLC
#
#       http://www.3rdcoast.com
#       support@3rdcoast.com
#
#   This CGI script takes the data entered in an HTML form 
#   and sends it via e-mail to the specified location.
#
#   EZ Form Mailer is available for anyone to use or modify for no charge.
#   All we ask is that you leave this copyright notice in the script
#   and readme.txt file.  If someone asks where you got the script, 
#   refer them to 3rd Coast Technologies.
#
#   Selling or distributing this program without prior written approval
#   is forbidden. 
#
############################################################################
#            Configuration Variables
#
#   The following variables are used to define how your form data
#   will be processed.  The data values can be defined here in the
#   script or optionally they can be sent from the form by hidden fields.
#
############################################################################
#
# $SENDMAIL  identifies the location of the send mail program on 
#       your server.  Verify this with your webmaster or isp.
#       ******************************************************
#       *** This variable MUST be specified here and   *** 
#       *** cannot be sent using hidden fields.   ***
#       ******************************************************
#
# @AUTHURLS  identifies the URL's that are authorized to use this 
#       CGI Script.  Be sure to include all possible variations.
#       ******************************************************
#       *** This variable MUST be specified here and   *** 
#       *** cannot be sent using hidden fields.   ***
#       ******************************************************
#
# $TO        the email address where the form data will be sent.
#
# $SUBJECT   the text that will be used for the subject of the email.
#
# $SORT_TYPE     defines the sort type for the form output.
#           Options are 'alphabetic', 'field', or 'none'.
#
# @SORT_FIELDS   If the $SORT_TYPE is 'field', enter the field names
#          in the desired print sequence.
#
#   When changing any of these values, be sure to include the single
#   quote marks around the values and the semi colon at the end of 
#   each statement.
#
############################################################################

$SENDMAIL = '/usr/sbin/sendmail';

@AUTHURLS = ('www.doemaariets.nl','doemaariets.nl');

$TO  = 'iets@ofniet.nl';

$SUBJECT  = 'Reactie internet formulier';

$SORT_TYPE = 'field';

@SORT_FIELDS = ('variable1','variable2','variable3','variable4');

############################################################################

# Check to make sure this script was called by an authorized URL(s)

    &check_url;

# Format Local Date/Time for Email Message Date

    &get_date;

# Reformat Form Contents

    &reformat_form_data;

# Send the form data to the recipient via e-mail

    &send_email;


    exit();

################################################################

sub check_url 
{
    if ($ENV{'HTTP_REFERER'}) 
    {
        foreach $AUTHURL (@AUTHURLS) 
        {
            if ($ENV{'HTTP_REFERER'} =~ /$AUTHURL/i) 
            {
                $check_url = '1';          
                last;
               }
            }
    }
    else 
    {
        $check_url = '1';
    }

    if ($check_url != 1) 
       {
           print "Content-type: text/html\n\n";
        print "<html>\n <head>\n  <title>Unauthorized URL Referrer - Access Denied</title>\n </head>\n";
            print " <body>\n  <center>\n   <h1>Unauthorized URL Referrer - Access Denied</h1>\n  </center>\n";
            print "The form that is trying to use this script resides at: \n";
            print "$ENV{'HTTP_REFERER'}, which is not allowed to access this cgi script.<p>\n";
            print "Sorry!\n";
            print "</body></html>\n";
        exit;
    }

}

sub get_date 
{
       @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
       @months = ('January','February','March','April','May','June','July',
        'August','September','October','November','December');

       ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
       if ($hour < 10) 
        { $hour = "0$hour"; }
       if ($min < 10) 
        { $min = "0$min"; }
       if ($sec < 10) 
        { $sec = "0$sec"; }
       if ($year < 10) 
        { $year = "0$year"; }
     if ($year < 90) 
        { $cent = "20"; }
    else
        { $cent = "19"; }

       $date = "$days[$wday], $months[$mon] $mday, $cent$year at $hour\:$min\:$sec";

    $mon = $mon + 1;
    if ($mon < 10) 
        { $mon = "0$mon"; }
     if ($mday < 10) 
        { $mday = "0$mday"; }

    $dateShort = "$cent$year\-$mon\-$mday";
    $timeShort = "$hour\:$min\:$sec";

}

sub reformat_form_data
{
    if ($ENV{'REQUEST_METHOD'} eq 'POST') 
    {
            # Get the input
            read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
            # Split the name-value pairs
            @pairs = split(/&/, $buffer);
       }
       else 
    {
          print "Content-type: text/html\n\n";
            print "<html>\n <head>\n  <title>Error: Request Method</title>\n </head>\n";
            print "<body>\n <center>\n\n <h1>Error: Request Method</h1>\n  </center>\n\n";
            print "The Request Method of the Form you submitted was not\n";
            print "POST.  Please check the form, and make sure the\n";
            print "method= statement is in upper case and is set to POST.\n";
            print "<p><hr size=7 width=75%><p>\n";
            print "<ul>\n";
            print "<li><a href=\"$ENV{'HTTP_REFERER'}\">Back to the Submission Form</a>\n";
            print "</ul>\n";
            print "</body></html>\n";
        exit;
       }
    foreach $pair (@pairs) 
    {
            ($name, $value) = split(/=/, $pair);
            $name =~ tr/+/ /;
            $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $value =~ tr/+/ /;
             $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $value =~ s/<!--(.|\n)*-->//g;
        if ($name eq 'email' || $name eq 'Name' && ($value)) 
        {
                $CONFIG{$name} = $value;
        }
        if ($name eq 'to_email' && ($value)) 
        {
            $TO = $value;
        }       
        elsif ($name eq 'subject' && ($value)) 
        {
            $SUBJECT = $value;
        }       
        elsif ($name eq 'redirect' && ($value)) 
        {
            $REDIRECT = $value;
        }       
        elsif ($name eq 'sort_type' && ($value)) 
        {
            $SORT_TYPE = $value;
        }               
        elsif ($name eq 'sort_fields' && ($value)) 
        {
            @SORT_FIELDS = split(/,/, $value);
        }       
        elsif ($FORM{$name} && ($value)) 
        {
            $FORM{$name} = "$FORM{$name}, $value";
         }
        elsif ($value) 
        {
                $FORM{$name} = $value;
            }
    }
}

sub send_email
{
# Build the 'from' address of the form: "name <email address>"

    $from_name=($CONFIG{'Name'} . " <" . $CONFIG{'email'} . "> ");

    open(MAIL,"|$SENDMAIL -t") || die "Can't open $mailprog!\n";

# Output the mail header

    print MAIL "To: $TO\r\n";
       print MAIL "From: $from_name\r\n";
    print MAIL "Reply-To: $from_name\r\n";
    print MAIL "Subject: $SUBJECT\r\n\n";  

# Output the mail message header with the Local Date/Time

    print MAIL "---------------------------------------------------------------\n\n";
    print MAIL "   The following information was submitted by: \n";
    print MAIL "   $CONFIG{'Name'} on $date\n\n";
    print MAIL "---------------------------------------------------------------\n\n";

# Output the mail body
# Optionally Sort and Print the name and value pairs in FORM array

    if ($SORT_TYPE eq 'alphabetic') 
    {
            foreach $key (sort keys %FORM) 
        {
               print MAIL "$key: $FORM{$key}\n\n";
            }
       }
       elsif ($SORT_TYPE eq 'field') 
    {
        foreach $SORT_FIELD (@SORT_FIELDS) 
        {
               if ($FORM{$SORT_FIELD}) 
            {
                    print MAIL "$SORT_FIELD:  $FORM{$SORT_FIELD}\n\n";
            }
        }
    }
       else 
    {
             foreach $key (keys %FORM) 
        {
              print MAIL "$key:  $FORM{$key}\n\n";
             }
    }

# Output the mail footer

    print MAIL "<REMOTE HOST>    $ENV{'REMOTE_HOST'}\n";
    print MAIL "<REMOTE ADDRESS> $ENV{'REMOTE_ADDR'}\n";
    print MAIL "<USER AGENT>     $ENV{'HTTP_USER_AGENT'}\r\n";

# Close the pipe and send the mail

    close(MAIL);
}

Bij deze code moet je duz wel invoeren welke variabelen je meestuurt, en die volgorde kun je dan weer in je email laten zetten. Tis voor mij lang geleden dat ik deze gebruikt heb, duz weet ook niet helemaal meer hoe hij werkt, en heb nu geen tijd (ook niet veel zin meer) om het te gaan bekijken :)
Pagina: 1