home *** CD-ROM | disk | FTP | other *** search
/ 24.172.56.42 / 24.172.56.42.tar / 24.172.56.42 / form / saleeby_contact.php
PHP Script  |  2010-04-28  |  4KB  |  83 lines

  1. <?PHP
  2. /*
  3. Simfatic Forms Main Form processor script
  4.  
  5. This script does all the server side processing. 
  6. (Displaying the form, processing form submissions,
  7. displaying errors, making CAPTCHA image, and so on.) 
  8.  
  9. All pages (including the form page) are displayed using 
  10. templates in the 'templ' sub folder. 
  11.  
  12. The overall structure is that of a list of modules. Depending on the 
  13. arguments (POST/GET) passed to the script, the modules process in sequence. 
  14.  
  15. Please note that just appending  a header and footer to this script won't work.
  16. To embed the form, use the 'Copy & Paste' code in the 'Take the Code' page. 
  17. To extend the functionality, see 'Extension Modules' in the help.
  18.  
  19. */
  20. require_once("./includes/saleeby_contact-lib.php");
  21. $formmailobj =  new FormMail("saleeby_contact");
  22. $formmailobj->setFormPage(sfm_readfile("./templ/saleeby_contact_form_page.txt"));
  23. $formmailobj->setFormID("504402ce-6994-402d-8d32-1569715ea688");
  24. $formmailobj->setFormKey("efdd7f00-6c77-43a0-b8b3-8fd839b0de9f");
  25. $formmailobj->setEmailFormatHTML(true);
  26. $formmailobj->EnableLogging(false);
  27. $formmailobj->SetErrorEmail("Toni Saleeby<tonisaleeby@bellsouth.net>");
  28. $formmailobj->SetDebugMode(false);
  29. $formmailobj->SetFromAddress("no-reply@saleeby-saliba.org");
  30. $formmailobj->SetCommonDateFormat("m-d-Y");
  31. $formmailobj->SetSingleBoxErrorDisplay(true);
  32. $fm_installer =  new FM_FormInstaller();
  33. $formmailobj->addModule($fm_installer);
  34.  
  35. $formmailobj->setIsInstalled(true);
  36. $sfm_captcha =  new FM_CaptchaCreator("Captcha");
  37. $sfm_captcha->SetSize(150,60);
  38. $sfm_captcha->SetCharset("2356789ABCDEFGHJKLMNPQRSTUVWXYZ");
  39. $sfm_captcha->SetCaseInsensitiveMatch(true);
  40. $sfm_captcha->SetNChars(5);
  41. $sfm_captcha->SetNLines(3);
  42. $sfm_captcha->SetFontFile("images/SFOldRepublicBold.ttf");
  43. $sfm_captcha->SetErrorStrings("Please input the code displayed in the image","Code does not match. Please try again.");
  44. $formmailobj->addModule($sfm_captcha);
  45.  
  46. $formfiller =  new FM_FormFillerScriptWriter();
  47. $formmailobj->addModule($formfiller);
  48.  
  49. $formmailobj->AddElementInfo("Name","text");
  50. $formmailobj->AddElementInfo("Email","text");
  51. $formmailobj->AddElementInfo("Message","multiline");
  52. $page_renderer =  new FM_FormPageRenderer();
  53. $formmailobj->addModule($page_renderer);
  54.  
  55. $validator =  new FM_FormValidator();
  56. $validator->addValidation("Name","req","Please fill in Name");
  57. $validator->addValidation("Name","maxlen=35","The length of the input for Name should not exceed 35");
  58. $validator->addValidation("Email","email","The input for Email should be a valid email value");
  59. $validator->addValidation("Email","maxlen=45","The length of the input for Email should not exceed 45");
  60. $validator->addValidation("Email","req","Please fill in Email");
  61. $validator->addValidation("Message","maxlen=10000","The length of the input for Message should not exceed 10000");
  62. $validator->addValidation("Message","regexp=/^[,\\.a-zA-Z0-9\\s]*$/","Please enter a valid input for Message");
  63. $formmailobj->addModule($validator);
  64.  
  65. $data_email_sender =  new FM_FormDataSender(sfm_readfile("./templ/saleeby_contact_email_subj.txt"),sfm_readfile("./templ/saleeby_contact_email_body.txt"),"%Email%");
  66. $data_email_sender->AddToAddr("Toni Saleeby<tonisaleeby@bellsouth.net>");
  67. $data_email_sender->AddToAddr("Jim Wear<lifelinz@nc.rr.com>");
  68. $data_email_sender->AddToAddr("Aleeta Williams<aw2004@embarqmail.com>");
  69. $data_email_sender->AddToAddr("Callie Stanley<CRS1920@aol.com>");
  70. $formmailobj->addModule($data_email_sender);
  71.  
  72. $autoresp =  new FM_AutoResponseSender(sfm_readfile("./templ/saleeby_contact_resp_subj.txt"),sfm_readfile("./templ/saleeby_contact_resp_body.txt"));
  73. $autoresp->SetToVariables("Name","Email");
  74. $formmailobj->addModule($autoresp);
  75.  
  76. $tupage =  new FM_ThankYouPage();
  77. $tupage->SetRedirURL("http://www.saleeby-saliba.org/thanks.htm");
  78. $formmailobj->addModule($tupage);
  79.  
  80. $sfm_captcha->SetValidator($validator);
  81. $formmailobj->ProcessForm();
  82.  
  83. ?>