Jump to content

Please Help - Want To Send Form To Selected Email Receipients


jimw396

Recommended Posts

Hi All!

PHP newbie here. I am trying very hard to work through this problem myself ( last 4 days) with no success. I have a form that I would like to be sent to individuals selected from a drop-down menu.

 

Here is the PHP script;

<?php

  $coordinator = $_REQUEST['coordinator'] ;

  $client = $_REQUEST['client'] ;

  $clientcontactname = $_REQUEST['clientcontactname'] ;

  $contactphonenumber = $_REQUEST['contactphonenumber'] ;

  $dateofclass = $_REQUEST['dateofclass'] ;

  $typeofclass = $_REQUEST['typeofclass'] ;

  $numberofdrivers = $_REQUEST['numberofdrivers'] ;

  $classlistreceived = $_REQUEST['classlistreceived'] ;

  $numberofinstructorsneeded = $_REQUEST['numberofinstructorsneeded'] ;

  $locationofclass = $_REQUEST['locationofclass'] ;

  $locationofdrivinglot = $_REQUEST['locationofdrivinglot'] ;

  $drivinglotcontactinformation = $_REQUEST['drivinglotcontactinformation'] ;

  $travelarrangementsneeded = $_REQUEST['travelarrangementsneeded'] ;

  $meetingroomarranged = $_REQUEST['meetingroomarranged'] ;

  $cateringarranged = $_REQUEST['cateringarranged'] ;

  $trafficconesneeded = $_REQUEST['trafficconesneeded'] ;

  $lcdprojector = $_REQUEST['lcdprojector'] ;

  $screen = $_REQUEST['screen'] ;

  $none = $_REQUEST['none'] ;

  $additionalnotes = $_REQUEST['additionalnotes'] ;

  $totalmessage = "

Coordinator:    $coordinator  \n

Client: $client  \n

Client Contact Name: $clientcontactname  \n

Contact Phone Number: $contactphonenumber  \n

Date of Class: $dateofclass  \n

Type of Class: $typeofclass  \n

Number of Drivers: $numberofdrivers  \n

Class List Received: $classlistreceived  \n

Number of Instructors Needed: $numberofinstructorsneeded \n

Location of Class: $locationofclass  \n

Location of Driving Lot: $locationofdrivinglot  \n

Driving Lot Contact Information: $drivinglotcontactinformation  \n

Travel Arrangements Needed: $travelarrangementsneeded  \n

Meeting Room Arranged: $meetingroomarranged  \n

Catering Arranged: $cateringarranged  \n

Traffic Cones Needed: $trafficconesneeded  \n

LCD Projector: $lcdprojector  \n

Screen: $screen  \n

AV Equipment Needed: $none  \n

Additional Notes: $additionalnotes \n";

 

 

mail( "[email protected]", "Training Assignment",

    $totalmessage, "From: [email protected]" );

  header( "Location: http://www.xxxxxxxx.html" );

 

Any help on solving this would be GREATLY appreciated. My head is getting sore from banging it against the wall. :confused:

 

Thanks,

Jim

?>

 

Thanks Zanus. The different recipients are pulled from the $coordinator = $_REQUEST['coordinator'] ; which is a select drop -down field. I have tried using the following code-

 

if(isset($_POST['coordinator']) && is_scalar($_POST['coordinator'])){

   switch ($_POST['coordinator']) {

   case 'XXX':

      $mailto = '[email protected]';

      break;

   case 'yyy':

      $mailto = '[email protected]';

      break;

   case 'zzz':

      $mailto = '[email protected]';

      break;

  case 'vvv':

      $mailto = '[email protected]';

      break;

 

Where are you suggesting I try \r\n instead of \n?

 

Thank you,

Jim

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.