<% my $FORM = $Request->Form(); foreach my $key ( keys %{$FORM} ) { ${$FORM}{$key} =~ s/'/`/sg; ${$FORM}{$key} = substr(${$FORM}{$key},0,155) unless $key eq 'address'; ${$FORM}{phone} = substr(${$FORM}{phone},0,20); } my $ERROR = ''; my $MESSAGE = ''; if ( ${$FORM}{send} ) { ${$FORM}{newsletter} = '1' if ${$FORM}{newsletter}; ${$FORM}{newsletter} = '0' if !${$FORM}{newsletter}; if ( ${$FORM}{firstname} && ${$FORM}{lastname} && ${$FORM}{job} && ${$FORM}{company} && ${$FORM}{email} && ${$FORM}{phone} && ${$FORM}{address} && ${$FORM}{postcode} && ${$FORM}{town} && ${$FORM}{country} ) { if ( valid_address(${$FORM}{email}) ) { my $dbh = dbcon(); $dbh->do(qq[ insert into members (firstname,lastname,job,company,email,phone,address,postcode,town,country,newsletter,site,registration_date,parallel) values ('${$FORM}{firstname}','${$FORM}{lastname}','${$FORM}{job}','${$FORM}{company}','${$FORM}{email}','${$FORM}{phone}','${$FORM}{address}','${$FORM}{postcode}','${$FORM}{town}','${$FORM}{country}',${$FORM}{newsletter},'${$FORM}{site}',now(),'${$FORM}{parallel}') ]) || die $dbh->errstr; $dbh->disconnect; ${$FORM}{saved} = 1; $MESSAGE = 'Thank you for submiting your details.'; } else { $ERROR = 'Your email is not valid!'; } } else { $ERROR = 'All fields are required!'; } } %> VIRTUALIZATION & CLOUD COMPUTING FORUM 2011