Source for file survey.php

Documentation is available at survey.php

  1. <?php
  2. /**
  3. * Install instructions
  4. @package Mambo
  5. @author Mambo Foundation Inc see README.php
  6. @copyright Mambo Foundation Inc.
  7. *  See COPYRIGHT.php for copyright notices and details.
  8. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
  9. *  LICENSE.php
  10. *  Mambo is free software; you can redistribute it and/or
  11. *  modify it under the terms of the GNU General Public License
  12. *  as published by the Free Software Foundation; version 2 of the
  13. *  License.
  14. */ 
  15.  
  16. // Set flag that this is a parent file
  17. define"_VALID_MOS");
  18.  
  19. // Test to see if the user has submitted the survey
  20. if (isset($_POST['name'])) {
  21.  
  22.     // Include common.php
  23.     require_once'common.php' );
  24.     
  25.     // Collect the survey information
  26.     $name mosGetParam$_POST'name''' );
  27.     $email mosGetParam$_POST'email''' );
  28.     $company mosGetParam$_POST'company''' );
  29.     $category mosGetParam$_POST'category''' );
  30.     $teammambo mosGetParam$_POST'teammambo''' );
  31.     $comments mosGetParam$_POST'comments''' );
  32.     
  33.     // Check for user's name and a valid email address
  34.     if (empty($name|| empty($email|| (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"$email))) {
  35.        $response 0;
  36.     }
  37.     else {
  38.        $response 1;
  39.     }
  40.        
  41.     //Build standard email headers
  42.     $headers "From: $email"\r\n"
  43.     . "Reply-To: $email"\r\n"
  44.     . 'X-Mailer: PHP/' phpversion();
  45.     
  46.     // Check to see if the user is interested in joining Team Mambo and process
  47.     if ($teammambo && $response{
  48.         $subject "Mambo Installation - Possible New Team Member";
  49.         $message "$name is interested in being a member of Team Mambo.  
  50.                . "Here are the details of the installation survey:\n"
  51.                . "\n" 
  52.                . "Name: $name\n"
  53.                . "Email: $email\n"
  54.                . "Category: $category\n"
  55.                . "Company: $company";
  56.     
  57.         //OK lets send the notice of interest
  58.         // No error checking on the send since this is just a nice to have
  59.         mail('membership@mambo-foundation.org'$subject$message$headers);
  60.     }
  61.     
  62.     // Check to see if the user left any comments and process
  63.     if ($response && $comments{
  64.         $subject "Mambo Installation - User Comments";
  65.         $message "$name left some comments on the installation survey.  
  66.                . "Here are the comments:\n"
  67.                . "\n"
  68.                . "Name: $name\n"
  69.                . "Email: $email\n"
  70.                . "Category: $category\n"
  71.                . "Company: $company\n"
  72.                . "Comments: $comments";
  73.     
  74.         // OK lets send the feedback email
  75.         // No error checking on the send since this is just a nice to have
  76.         mail('feedback@mambo-foundation.org'$subject$message$headers);
  77.  
  78.     }
  79.  
  80. }
  81.  
  82. //Redirect user to the frontpage
  83. Header('Location: ../index.php');
  84.  
  85. ?>

Documentation generated on Mon, 05 May 2008 16:22:55 +0400 by phpDocumentor 1.4.0