Field Type Collation Attributes Null Default Extra Action name varchar(128) latin1_german2_ci No country varchar(128) latin1_german2_ci No language varchar(128) latin1_german2_ci No union varchar(128) latin1_german2_ci No title varchar(128) latin1_german2_ci Yes NULL email varchar(128) latin1_german2_ci No cellphone varchar(128) latin1_german2_ci Yes NULL landlinephone varchar(128) latin1_german2_ci Yes NULL facebook varchar(128) latin1_german2_ci Yes NULL skype varchar(128) latin1_german2_ci Yes NULL twitter varchar(128) latin1_german2_ci Yes NULL gender varchar(16) latin1_german2_ci No age varchar(64) latin1_german2_ci No needshelp varchar(16) latin1_german2_ci No #### #!/usr/bin/perl print "Content-type: text/html\n\n"; use CGI qw(param); $name = param("pname"); $country = param("pcountry"); $language = param("planguage"); $union = param("punion"); $title = param("ptitle"); $email = param("pemail"); $cellphone = param("pcellphone"); $landlinephone = param("plandlinephone"); $facebook = param("pfacebook"); $skype = param("pskype"); $twitter = param("ptwitter"); $gender = param("pgender"); $age = param("page"); $needshelp = param("pneedshelp"); # 1 Adds record to database of registrants use DBI; $db = DBI->connect('******','**********','******'); my $sth = $db->prepare("insert into istanbul2011(name, country, language, union, title, email, cellphone, landlinephone, facebook, skype, twitter, gender, age, needshelp) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $sth->execute($name, $country, $language, $union, $title, $email, $cellphone, $landlinephone, $facebook, $skype, $twitter, $gender, $age, $needshelp); $db->disconnect(); # 2 Sends an email confirmation message to us $to = "ericlee\@labourstart.org"; $from = "ericlee\@labourstart.org"; $content1 = "Name: $name\nCountry: $country\nEmail: $email\nUnion: $union\nTitle: $title\nLanguage: $language\nCell phone: $cellphone\nLandline phone: $landlinephone\nFacebook: $facebook\nSkype: $skype\nTwitter: $twitter\nGender: $gender\nAge: $age\nNeeds help: $needshelp"; open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL "To: $to\nFrom: $email\n"; print MAIL "Subject: $name from $country has registered to attend the LabourStart conference\n"; print MAIL "The following application form has been submitted:\n\n$content1\n"; close (MAIL); # 3 Sends an email confirmation message to the registrant $content2 = "Dear $name \n\nThank you for registering to attend the LabourStart conference this year.\n\nFor full information about the conference, please make sure to visit http://www.labourstart.org/2011.\n\n\We'll be writing to you again closer to the date of the event.\n\nLooking forward to seeing you there.\n\nEric Lee\n"; open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL "To: $email \nFrom: $from\n"; print MAIL "Subject: Thank you for registering to attend the LabourStart conference\n"; print MAIL "$content2\n"; close (MAIL); # 4 Posts a thank you message on the screen, also showing details submitted print qq| Thank you!

The following information has been added to our database of conference registrants:

Name: $name

Country: $country

Language: $language

Union: $union

Title: $title

Email: $email

Cellphone: $cellphone

Landlinephone: $landlinephone

Facebook: $facebook

Skype: $skype

Twitter: $twitter

Gender: $gender

Age: $age

Needshelp: $needshelp


You have been sent a confirmation email message.
Click here to return to our conference website

|;