hi everyone,
hope someone can help...i have a mail registration page where the user fills out his/her information and then submits the form...i tried using php but i couldn't get the info to be entered into the database, now i thought maybe i'll use perl and see what happens...but same thing, the information is not entered into the db...
basically the mail page contains 3 text boxes, one each for first name, last name, and email address, a drop down list to select country, a check box to receive email updates, 3 more check boxes to choose what the person is interested in and another drop down to select an area of interest...
so in total there are 9 fields...3 text boxes, 2 drop down lists, and 4 checkboxes...
of course i have named them and given a value of 1 to the checkboxes...
i'm posting my perl code to process the information...let me know if i need anything else...
if someone can help, please do...
thanks a whole bunch...
arif X-) s-) (-:
hope someone can help...i have a mail registration page where the user fills out his/her information and then submits the form...i tried using php but i couldn't get the info to be entered into the database, now i thought maybe i'll use perl and see what happens...but same thing, the information is not entered into the db...
basically the mail page contains 3 text boxes, one each for first name, last name, and email address, a drop down list to select country, a check box to receive email updates, 3 more check boxes to choose what the person is interested in and another drop down to select an area of interest...
so in total there are 9 fields...3 text boxes, 2 drop down lists, and 4 checkboxes...
of course i have named them and given a value of 1 to the checkboxes...
i'm posting my perl code to process the information...let me know if i need anything else...
Code:
#!/usr/local/bin/perl
use CGI qw(:standard);
use DBI;
my $dbh = DBI->connect("DBI:mysql:mailform:localhost", "root", "") or die "Can't get DBH: $DBI::errstr";
$query = new CGI;
print "Location: thankyou.shtml\n\n";
#print "Content-type: text/html\n\n";
$name=$query->param('fname');
$lname=$query->param('lname');
$email=$query->param('email');
$country=$query->param('country');
$oktoemailme=$query->param('email_ok');
$feature=$query->param('feature_stories');
$light=$query->param('how_to_light');
$news=$query->param('site_news');
$job=$query->param('occupation');
$sql= "insert into user (fname, lname, email, country, oktoemailme, feature, light, news, job) values (?,?,?,?,?,?,?,?,?)";
my $sth = $dbh->prepare("$sql") or return;
$sth->execute($fname, $lname, $email, $country, $oktoemailme, $feature, $light, $news, $job,);
$autoid= $sth->{"mysql_insertid"};
if someone can help, please do...
thanks a whole bunch...
arif X-) s-) (-: