############################################################################### # register.cgi # # This script takes the registration information, saves it in the database and # generates a confirmation page in the appropriate language. # # Author: John Quinn (jquinn@sapient.com) # 06.06.2001 ############################################################################### use DBI; use CGI qw(:standard); $error = "false"; $error_html = "error"; $valid_html = "body"; $err_first = $valid_html; $err_last = $valid_html; $err_publicat = $valid_html; $err_contact = $valid_html; $err_city = $valid_html; $err_street1 = $valid_html; $err_street2 = $valid_html; $err_state = $valid_html; $err_postalcode = $valid_html; $err_country = $valid_html; $err_email = $valid_html; $err_telephone = $valid_html; $err_fax = $valid_html; if (param("submit") eq "") { registration(); } else { # Get the form data $first = param("first"); if ($first eq "") {$error="true"; $err_first=$error_html} $last = param("last"); if ($last eq "") {$error="true"; $err_last=$error_html} $publication = param("publication"); if ($publication eq "") {$error="true"; $err_pub=$error_html} $contact = param("contact") || " "; $city = param("city") || " "; if (($contact eq "mail") && ($city eq " ")) {$error="true"; $err_city=$error_html} $street1 = param("street1") || " "; if (($contact eq "mail") && ($street1 eq " ")) {$error="true"; $err_street1=$error_html} $street2 = param("street2") || " "; $state = param("state") || " "; # if (($contact eq "mail") && ($state eq " ")) {$error="true"; $err_state=$error_html} $postalcode = param("postalcode") || " "; if (($contact eq "mail") && ($postalcode eq " ")) {$error="true"; $err_post=$error_html} $country = param("country") || " "; if (($contact eq "mail") && ($country eq " ")) {$error="true"; $err_country=$error_html} $email = param("email") || " "; if (!($email =~ /(.+)@(.+)\.(.+)/) && ($contact eq "email")) {$error="true"; $err_email=$error_html} $telephone = param("telephone") || " "; $fax = param("fax") || " "; if (($contact eq "fax") && ($fax eq " ")) {$error="true"; $err_fax=$error_html} if ($error eq "true") # redirect back to the registration page { registration(); } else { print header(); # Strip out rogue characters $first =~ s/\'|\"|\|\\n;/ /g; $last =~ s/\'|\"|\|;|\\n/ /g; $publication =~ s/\'|\"|\|\\n;/ /g; $city =~ s/\'|\"|\;|\\n/ /g; $street1 =~ s/\'|\"|\;|\\n/ /g; $street2 =~ s/\'|\"|\;|\\n/ /g; $state =~ s/\'|\"|\;|\\n/ /g; $postalcode =~ s/\'|\"|\;|\\n/ /g; $country =~ s/\'|\"|\;|\\n/ /g; $email =~ s/\'|\"|\;|\\n/ /g; $telephone =~ s/\'|\"|\;|\\n/ /g; $fax =~ s/\'|\"|\;|\\n/ /g; $contact =~ s/\'|\"|\;|\\n/ /g; $language =~ s/\'|\"|\;|\\n/ /g; # Get a handle on the database $dbh = DBI->connect(q{dbi:ODBC:otp_interim}, {RaiseError => 1, PrintError => 1, AutoCommit => 1}); # Construct SQL statement $sqlstatement="INSERT INTO press (first_name, last_name, publication, city, street1, street2, state, postal_code, country, email, telephone, fax, contact_pref) VALUES ('$first','$last','$publication','$city','$street1','$street2','$state', '$postalcode','$country','$email','$telephone','$fax','$contact')\n"; #print $sqlstatement; # Prepare and execute SQL statement $sth = $dbh->prepare($sqlstatement); $sth->execute || die "Could not execute SQL statement"; $dbh->disconnect; # Display confirmation confirmation(); } } ######################### SHOW CONFIRMATION PAGE ############################## sub confirmation { print < Opodo | Confirmation
Opodo
About us
Newsroom
News releases

Register

-->
Careers

Confirmation

Thank you for registering with the Opodo's Newsroom. We will keep you informed as our business evolves. For additional press details, interviews, photos and news queries, please feel free to directly contact our Corporate Communications office on:

+44 (0) 207664 7804 or email on pr\@opodo.com


Opodo is owned by:
Aer Lingus, Air France, Alitalia, Austrian Airlines, British Airways, Finnair, Iberia, KLM, Lufthansa and Amadeus




Copyright Opodo 2002
END } ########################## SHOW REGISTRATION PAGE ############################# sub registration { $first =~ s/^ //; $last =~ s/^ //; $publication =~ s/^ //; $city =~ s/^ //; $street1 =~ s/^ //; $street2 =~ s/^ //; $state =~ s/^ //; $postalcode =~ s/^ //; $country =~ s/^ //; $email =~ s/^ //; $telephone =~ s/^ //; $fax =~ s/^ //; $contact =~ s/^ //; $language =~ s/^ //; print header(); print < Opodo | Register
Opodo
About us
Press area
News releases

Register

-->
Careers

Register

Welcome to the newsroom at Opodo, your gateway to the new online travel company created by nine of Europes leading airlines.

To receive the latest news from Opodo, please provide your details below to receive updates from our Newsroom as we develop (please see our privacy details).

To unsubscribe from this list, please send an email (with the word Unsubscribe in the subject list) to unsubscribe\@opodo.com.
NB: This email is automated and general enquiries should be addressed in writing to our Corporate head office. See About Us section for details.

* = Required
END if ($error eq "true") { print <
Correction is needed at the highlighted sections
END } print <
Your name:
*First:
*Last:
*Publication -
enter publication, freelance or association/company name
Mailing information:
Street address:

City:
Postal code:
County or province:
Country:
Additional contact information:
Email address:
Telephone:
Fax:
*How do you prefer to receive press information? (Please select)
 E-mail Fax Mail


Opodo is created by:
Aer Lingus, Air France, Alitalia, Austrian Airlines, British Airways, Finnair, Iberia, KLM and Lufthansa




Copyright Opodo 2006
END }