Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: What do YOU think (improve add routine)

Quote Reply
Re: What do YOU think (improve add routine) In reply to
Just for the record: This is what I did!

Added the following in my site_html.pl at add_ en error_:
Code:
add: <input type="hidden" name="UserID" value="false">
error: <input type="hidden" name="UserID" value="$in{'UserID'}">
I use UserID just because It sounds cool!


.....and this is what I added to add.cgi:

In plain english:
I save some input from every entry that fails validation.
(...at least if they provide me a valid email and e serious name.)


Code:
else {
# Print out the input to the error database. But only
# the first time this error happens. (saves server-space)
if ($in{'UserID'} eq "false") {
if (($in{'Email'} =~ /. \@. \.. /) && ($in{'Nachname'} !~ /^\s*$/)) {
open (DB, ">>$db_request_error_name") or &cgierr("error in add_record. unable to open database file: $db_request_error_name. Reason: $!");
flock(DB, 2) unless (!$db_use_flock);
print DB "$in{$db_cols[$db_modified]}$db_delim$ENV{'REMOTE_ADDR'}$db_delim$in{'Email'}$db_delim$in{'Nachname'}$db_delim$in{'Anrede'}$db_delim\n";
close DB; # automatically removes file lock
$in{'UserID'} = "true";
}
}
# Send the visitor to the error page.
&site_html_request_error ($status);
}
That's right: German!

I would prefer to strip | and spaces, but I don't know how &join_encode(.........); will act if there's no hash. Who has some tips for me! (Or would it slow down the proccess to much?)


....and I'm planning to make a seperate script that will:

- check alle emailadresses agains the real and validate database.
- check for double emailadresses.
- send "he, something went wrong, please fill in our form again" email to all adresses.
- save emailed adresses in seperate file, so they don't get mailed again.

DID I MISS ANYTHING GUYS ??? LET ME KNOW !!!


Subject Author Views Date
Thread What do YOU think (improve add routine) cK 1029 Jun 23, 2000, 3:24 PM
Thread Re: What do YOU think (improve add routine)
Stealth 985 Jun 23, 2000, 3:42 PM
Post Re: What do YOU think (improve add routine)
cK 965 Jun 24, 2000, 11:31 AM