Jump to content

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( "jim@xxxxxxxx.com", "Training Assignment",

    $totalmessage, "From: Tom@xxxxxxxx.com" );

  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 = 'jim@xxx.com';

      break;

   case 'yyy':

      $mailto = 'john@xxx.com';

      break;

   case 'zzz':

      $mailto = 'zzz@xxx.com';

      break;

  case 'vvv':

      $mailto = 'dddd@xxx.com';

      break;

 

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

 

Thank you,

Jim

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.