mail/confirmation help I'm at your mercy ! :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

Okay so I have some code that I will post below but perhaps I should explain what I am trying to do.I have a web form set up for my agents to log in and input their booked appointments and manipulate a prewritten message(all except the url). On click of the submit buttom I have to have a few things happening: I have the a email sent to me and my assistant and the broker with the information input on the form. Then I have a email going to the client with the letter and the url address to rsvp and confirm the appointment. At the same time the entire form is uploaded into my database. I have the database working just fine but for some reason I am having errors in my code I am having trouble sending out the email to me and my assistant with all the information. Also onclick of the submit button I tried to input a popup message with a warning because my agents don't tend to pay attention. I will copy and paste the page on here so you can see the whole thing. Seems like a lot going on.. I am fairly new to php but I have googled it I have 5 books from the library I truly and stuck. Thanks again

Code: Select all

<?php require_once('../Connections/spartanwisdom.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bopconfirmation")) {
  $insertSQL = sprintf("INSERT INTO BOPConfirmation (`Date`, AgentCode, AgentName, GuestName, GuestEmail, GuestPhone, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['date'], "date"),
                       GetSQLValueString($_POST['agentcode'], "text"),
                       GetSQLValueString($_POST['agentname'], "text"),
                       GetSQLValueString($_POST['guestname'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['guestnumber'], "text"),
                       GetSQLValueString($_POST['email'], "text"));
 
  mysql_select_db($database_spartanwisdom, $spartanwisdom);
  $Result1 = mysql_query($insertSQL, $spartanwisdom) or die(mysql_error());
}
?>
<style type="text/css">
  .label{
    text-align:right;
  }
  #submit{
    text-align:center;
  }
body,td,th {
    color: #000000;
}
body {
    background-color: #CCCCCC;
}
a:hover {
    color: #0099CC;
}
a:visited {
    color: #9933CC;
}
.style1 {
    color: #FF0000;
    font-weight: bold;
}
</style>
<?php
  $to='deniseadkins83@gmail.com';
  $from='info@spartanwisdom.com';
  $messageSubject='BOP Attendee Confirmation Call';
  $confirmationSubject='Tuesday Night Attendance Instructions';
  $confirmationBody= "www.spartanwisdom.com/bop/invitedtobop/bopinvitedvideodayof.html";
  $name='';
  $guestname='';
  $phone='';
  $bopdate='';
  $email='';
  $body='';
  $displayForm=true;
  if ($_POST){
    $email=stripslashes($_POST['email']);
    $body=stripslashes($_POST['body']);
    $name=stripslashes($_POST['name']);
    $guestname=stripslashes($_POST['guestname']);
    $phone=stripslashes($_POST['phone']);
    $bopdate=stripslashes($_POST['bopdate']);
    // validate e-mail address
    $valid=eregi('^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$',$email);
    $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$body);
    if ($name && $guestname && $phone && $bopdate && $email && $body && $valid && !$crack){
      if (mail($to,$messageSubject,$name.$guestname.$phone.$bopdate.$body,'From: '.$from."\r\n")
          && mail($email,$confirmationSubject,$confirmationBody.$body,'From: '.$from."\r\n")){
        $displayForm=false;
?>
<script type="text/javascript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
<p>
  Your message was successfully sent.
  In addition, a confirmation copy was sent to your e-mail address.
  Your message is shown below.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
        echo '<p>'.htmlspecialchars($body).'</p>';
      }else{ // the messages could not be sent
?>
<p>
  Something went wrong when the server tried to send your message.
  This is usually due to a server error, and is probably not your fault.
  We apologise for any inconvenience caused.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
      }
    }else if ($crack){ // cracking attempt
?>
<p><strong>
  Your message contained e-mail headers within the message body.
  This seems to be a cracking attempt and the message has not been sent.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
    }else{ // form not complete
?>
<p><strong>
  Your message could not be sent.
  You must include both a valid e-mail address and a message.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<p>
  <?php
    }
  }
  if ($displayForm){
?>
</p>
<p>Please Enter all the Information in for the Invite, this way we have a  faster more streamlined sign in process and also more organized follow  up and confirmation. They will receive a phone call reminder and a  email reminder as well. Please make sure that you add your invites the  day you invited them this way the email that goes out is a fresh  reminder.</p>
<p><span class="style1">**Please make sure that these are solid  invites, meaning that they have confirmed to you that they will be  attending the meeting. This is not a confirmation for someone you asked  to come to a meeting and they said they might make it. This is a call  to say we are reminding you of the appointment you scheduled with  'inviter' to attend our company overview. Also please note that the guest email must be filled out correctly for the guest to receive the confirmation email. Also the standard pre-written letter is in the last box. Feel free to add a salutation or a personal touch to the email. The guest will recieve the email with a link that will send them to a site to fill out a rsvp form and instructions and directions.**</span></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="bopconfirmation" id="bopconfirmation">
  <table>
    <tr>
      <td class="label">Date of BOP Guest Attending:</td>
      <td><label>
        <input name="date" type="text" id="date" value="<?php echo htmlspecialchars($bopdate); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Agent Code:</td>
      <td><label>
        <input type="text" name="agentcode" id="agentcode">
      </label></td>
    </tr>
    <tr>
      <td class="label"><label for="email">Agent Name:</label></td>
      <td><label>
        <input name="agentname" type="text" id="agentname" value="<?php echo htmlspecialchars($name); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Guest Name:</td>
      <td><label>
        <input name="guestname" type="text" id="guestname" value="<?php echo htmlspecialchars($guestname); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Guest Email:</td>
      <td><input type="text" name="email" id="email" value="<?php echo htmlspecialchars($email); ?>" size="30" />      
      (a confirmation e-mail will be sent to this address) </td>
    </tr>
    <tr>
      <td class="label">Guest Phone Number:</td>
      <td><label>
        <input name="guestnumber" type="text" id="guestnumber" value="<?php echo htmlspecialchars($phone); ?>">
      </label></td>
    </tr>
    
    <tr>
      <td class="label"><label for="body">Confirmation email that goes to guest<br>
        
      :</label></td>
      <td><textarea name="body" id="body" cols="70" rows="5">Thanks for confirming your attendance to our tuesday night open house. We look forward to meeting you. Please go to the following link for further instructions and directions to our office. Again we look forward to meeting you.
 
 <?php echo htmlspecialchars($body); ?>
 
Thanks Again
Denise Adkins
Director of Operations
Global Financial Advisors
       
      </textarea></td>
    </tr>
    <tr><td id="submit" colspan="2"><button type="submit" onclick="MM_popupMsg('Please make sure you are clear on instructions. Make sure guest email is filled out properly so that your guest received the rsvp email. Corey will recieve a copy of this and call your invitee accordingly.')">Send Confirmation</button></td></tr>
  </table>
  <input type="hidden" name="MM_insert" value="bopconfirmation">
</form>
<?php
  }
?>
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by infolock »

Make sure to post the error you are seeing on the page. It makes debugging much easier ;)

As for issues, well there are quite a few. You are calling $_POST values that don't exist (ie: $_POST['bopdate']

From what I see in this code, there is no form element with the name of bopdate

I hope I'm not being too simple here with you, but $_POST is just a superglobal variable. What that means is, it takes your HTML <form>'s values (ie: the <input type="text" name="date" value="" />) and stores them all as one big array (ie: the date field becomes $_POST['date'] when you click submit and the page is directed to the action file.)

with that being the case, you are checking for $_POST values that don't exist.

In case you were wondering, stripslashes just says "Take this variable, and remove all backslashes from the value.". This is usually done because you have magic quotes turned on, which is a setting in the php.ini file, which adds backslashes to your values automatically for you (so, the word you're will become you\\'re)

Anyways, just post the error, and we'll see what we can get for you.
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

Thanks, I made a couple changes this is the error that I am getting :
Parse error: syntax error, unexpected '}' in /hermes/bosweb/web026/b263/sl.necee8483/public_html/test/test2.php on line 148

(thanks so much I really appreciate it. I am trying to learn.

Code: Select all

<?php require_once('../Connections/spartanwisdom.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bopconfirmation")) {
  $insertSQL = sprintf("INSERT INTO BOPConfirmation (`Date`, AgentCode, AgentName, GuestName, GuestEmail, GuestPhone, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['date'], "date"),
                       GetSQLValueString($_POST['agentcode'], "text"),
                       GetSQLValueString($_POST['agentname'], "text"),
                       GetSQLValueString($_POST['guestname'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['guestnumber'], "text"),
                       GetSQLValueString($_POST['email'], "text"));
 
  mysql_select_db($database_spartanwisdom, $spartanwisdom);
  $Result1 = mysql_query($insertSQL, $spartanwisdom) or die(mysql_error());
}
?>
<style type="text/css">
  .label{
    text-align:right;
  }
  #submit{
    text-align:center;
  }
body,td,th {
    color: #000000;
}
body {
    background-color: #CCCCCC;
}
a:hover {
    color: #0099CC;
}
a:visited {
    color: #9933CC;
}
.style1 {
    color: #FF0000;
    font-weight: bold;
}
</style>
<?php
  $to='deniseadkins83@gmail.com';
  $from='info@spartanwisdom.com';
  $messageSubject='BOP Attendee Confirmation Call';
  $confirmationSubject='Tuesday Night Attendance Instructions';
  $confirmationBody= "www.spartanwisdom.com/bop/invitedtobop/bopinvitedvideodayof.html";
  $name='';
  $guestname='';
  $phone='';
  $bopdate='';
  $email='';
  $body='';
  $displayForm=true;
  if ($_POST){
    $email=stripslashes($_POST['email']);
    $body=stripslashes($_POST['body']);
    $name=stripslashes($_POST['name']);
    $guestname=stripslashes($_POST['guestname']);
    $phone=stripslashes($_POST['phone']);
    $bopdate=stripslashes($_POST['bopdate']);}
    // validate e-mail address
    $valid=eregi('^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$',$email);
    $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$body);
    $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$name);
    $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$guestname);
    $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$phone);
    $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$bopdate);
    if ($name && $guestname && $phone && $bopdate && $email && $body && $valid && !$crack){
      if (mail($to,$messageSubject,$name.$guestname.$phone.$bopdate.$body,'From: '.$from."\r\n")
          && mail($email,$confirmationSubject,$confirmationBody.$body,'From: '.$from."\r\n")){
        $displayForm=false;
?>
<script type="text/javascript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
<p>
  Your message was successfully sent.
  In addition, a confirmation copy was sent to your e-mail address.
  Your message is shown below.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
        echo '<p>'.htmlspecialchars($body).'</p>';
      }else{ // the messages could not be sent
?>
<p>
  Something went wrong when the server tried to send your message.
  This is usually due to a server error, and is probably not your fault.
  We apologise for any inconvenience caused.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
      }
    }else if ($crack){ // cracking attempt
?>
<p><strong>
  Your message contained e-mail headers within the message body.
  This seems to be a cracking attempt and the message has not been sent.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
    }else{ // form not complete
?>
<p><strong>
  Your message could not be sent.
  You must include both a valid e-mail address and a message.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<p>
  <?php
    }
  }
  if ($displayForm){
?>
</p>
<p>Please Enter all the Information in for the Invite, this way we have a  faster more streamlined sign in process and also more organized follow  up and confirmation. They will receive a phone call reminder and a  email reminder as well. Please make sure that you add your invites the  day you invited them this way the email that goes out is a fresh  reminder.</p>
<p><span class="style1">**Please make sure that these are solid  invites, meaning that they have confirmed to you that they will be  attending the meeting. This is not a confirmation for someone you asked  to come to a meeting and they said they might make it. This is a call  to say we are reminding you of the appointment you scheduled with  'inviter' to attend our company overview. Also please note that the guest email must be filled out correctly for the guest to receive the confirmation email. Also the standard pre-written letter is in the last box. Feel free to add a salutation or a personal touch to the email. The guest will recieve the email with a link that will send them to a site to fill out a rsvp form and instructions and directions.**</span></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="bopconfirmation" id="bopconfirmation">
  <table>
    <tr>
      <td class="label">Date of BOP Guest Attending:</td>
      <td><label>
        <input name="bopdate" type="text" id="bopdate" value="<?php echo htmlspecialchars($bopdate); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Agent Code:</td>
      <td><label>
        <input type="text" name="agentcode" id="agentcode">
      </label></td>
    </tr>
    <tr>
      <td class="label"><label for="email">Agent Name:</label></td>
      <td><label>
        <input name="name" type="text" id="name" value="<?php echo htmlspecialchars($name); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Guest Name:</td>
      <td><label>
        <input name="guestname" type="text" id="guestname" value="<?php echo htmlspecialchars($guestname); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Guest Email:</td>
      <td><input type="text" name="email" id="email" value="<?php echo htmlspecialchars($email); ?>" size="30" />      
      (a confirmation e-mail will be sent to this address) </td>
    </tr>
    <tr>
      <td class="label">Guest Phone Number:</td>
      <td><label>
        <input name="phone" type="text" id="phone" value="<?php echo htmlspecialchars($phone); ?>">
      </label></td>
    </tr>
    
    <tr>
      <td class="label"><label for="body">Confirmation email that goes to guest<br>
        
      :</label></td>
      <td><textarea name="body" id="body" cols="70" rows="5">Thanks for confirming your attendance to our tuesday night open house. We look forward to meeting you. Please go to the following link for further instructions and directions to our office. Again we look forward to meeting you.
 
 <?php echo htmlspecialchars($body); ?>
 
Thanks Again
Denise Adkins
Director of Operations
Global Financial Advisors
       
      </textarea></td>
    </tr>
    <tr><td id="submit" colspan="2"><button type="submit" onclick="MM_popupMsg('Please make sure you are clear on instructions. Make sure guest email is filled out properly so that your guest received the rsvp email. Corey will recieve a copy of this and call your invitee accordingly.')">Send Confirmation</button></td></tr>
  </table>
  <input type="hidden" name="MM_insert" value="bopconfirmation">
</form>
<?php
  }
?>
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by Stryks »

What are you using to wite your code in? Do you have code coloring, code indenting and line numbering? If not, perhaps consider looking for another tool. It's a pretty simple find from the error message in that environment.
necee8483 wrote:Parse error: syntax error, unexpected '}' in /hermes/bosweb/web026/b263/sl.necee8483/public_html/test/test2.php on line 148
Line 148 is ...

Code: Select all

 }
Basically, this close bracket doesn't have a corresponding opening bracket. If you remove that bracket, you should get no error, though I somehow doubt that the code will work as you might expect.

Anyhow, I was having trouble following the logic, so I swapped a few things around (and made a few mods) to try and make heads or tails of it ... perhaps it might help to see it .

Code: Select all

<?php
    require_once('../Connections/spartanwisdom.php'); 
?>
 
<style type="text/css">
  .label{
    text-align:right;
  }
  #submit{
    text-align:center;
  }
body,td,th {
    color: #000000;
}
body {
    background-color: #CCCCCC;
}
a:hover {
    color: #0099CC;
}
a:visited {
    color: #9933CC;
}
.style1 {
    color: #FF0000;
    font-weight: bold;
}
</style>
 
<script type="text/javascript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
 
<?php
    if (!function_exists("GetSQLValueString")) {
        function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {
            $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
            $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
            switch ($theType) {
                case "text":
                    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                    break;    
                case "long":
                case "int":
                    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
                    break;
                case "double":
                    $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
                    break;
                case "date":
                    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                    break;
                case "defined":
                    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
                    break;
            }
            return $theValue;
        }
    }
     
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
     
    if($_SERVER['REQUEST_METHOD'] != 'POST') {
 
        if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bopconfirmation")) {
          $insertSQL = sprintf("INSERT INTO BOPConfirmation (`Date`, AgentCode, AgentName, GuestName, GuestEmail, GuestPhone, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                               GetSQLValueString($_POST['date'], "date"),
                               GetSQLValueString($_POST['agentcode'], "text"),
                               GetSQLValueString($_POST['agentname'], "text"),
                               GetSQLValueString($_POST['guestname'], "text"),
                               GetSQLValueString($_POST['email'], "text"),
                               GetSQLValueString($_POST['guestnumber'], "text"),
                               GetSQLValueString($_POST['email'], "text"));
         
          mysql_select_db($database_spartanwisdom, $spartanwisdom);
          $Result1 = mysql_query($insertSQL, $spartanwisdom) or die(mysql_error());
        }
 
    
        $to='deniseadkins83@gmail.com';
        $from='info@spartanwisdom.com';
        $messageSubject='BOP Attendee Confirmation Call';
        $confirmationSubject='Tuesday Night Attendance Instructions';
        $confirmationBody= "www.spartanwisdom.com/bop/invitedtobop/bopinvitedvideodayof.html";
 
        $email=stripslashes($_POST['email']);
        $body=stripslashes($_POST['body']);
        $name=stripslashes($_POST['name']);
        $guestname=stripslashes($_POST['guestname']);
        $phone=stripslashes($_POST['phone']);
        $bopdate=stripslashes($_POST['bopdate']);
        // validate e-mail address
        $valid=eregi('^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$',$email);
        $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$body);
        $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$name);
        $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$guestname);
        $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$phone);
        $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$bopdate);
        if ($name && $guestname && $phone && $bopdate && $email && $body && $valid && !$crack){
            if (mail($to,$messageSubject,$name.$guestname.$phone.$bopdate.$body,'From: '.$from."\r\n") && mail($email,$confirmationSubject,$confirmationBody.$body,'From: '.$from."\r\n")){
                // The message was sent
?>
<p>
  Your message was successfully sent.
  In addition, a confirmation copy was sent to your e-mail address.
  Your message is shown below.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
                echo '<p>'.htmlspecialchars($body).'</p>';
            } else { 
                // The message could not be sent
?>
<p>
  Something went wrong when the server tried to send your message.
  This is usually due to a server error, and is probably not your fault.
  We apologise for any inconvenience caused.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
            }
        } else {
            if ($crack) { 
                // cracking attempt
?>
<p><strong>
  Your message contained e-mail headers within the message body.
  This seems to be a cracking attempt and the message has not been sent.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
            } else {    
                // form not complete
?>
<p><strong>
  Your message could not be sent.
  You must include both a valid e-mail address and a message.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<p>
<?php
            }
        }
    } else {
        // Display the form
?>
</p>
<p>Please Enter all the Information in for the Invite, this way we have a  faster more streamlined sign in process and also more organized follow  up and confirmation. They will receive a phone call reminder and a  email reminder as well. Please make sure that you add your invites the  day you invited them this way the email that goes out is a fresh  reminder.</p>
<p><span class="style1">**Please make sure that these are solid  invites, meaning that they have confirmed to you that they will be  attending the meeting. This is not a confirmation for someone you asked  to come to a meeting and they said they might make it. This is a call  to say we are reminding you of the appointment you scheduled with  'inviter' to attend our company overview. Also please note that the guest email must be filled out correctly for the guest to receive the confirmation email. Also the standard pre-written letter is in the last box. Feel free to add a salutation or a personal touch to the email. The guest will recieve the email with a link that will send them to a site to fill out a rsvp form and instructions and directions.**</span></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="bopconfirmation" id="bopconfirmation">
  <table>
    <tr>
      <td class="label">Date of BOP Guest Attending:</td>
      <td><label>
        <input name="bopdate" type="text" id="bopdate" value="<?php echo htmlspecialchars($bopdate); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Agent Code:</td>
      <td><label>
        <input type="text" name="agentcode" id="agentcode">
      </label></td>
    </tr>
    <tr>
      <td class="label"><label for="email">Agent Name:</label></td>
      <td><label>
        <input name="name" type="text" id="name" value="<?php echo htmlspecialchars($name); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Guest Name:</td>
      <td><label>
        <input name="guestname" type="text" id="guestname" value="<?php echo htmlspecialchars($guestname); ?>">
      </label></td>
    </tr>
    <tr>
      <td class="label">Guest Email:</td>
      <td><input type="text" name="email" id="email" value="<?php echo htmlspecialchars($email); ?>" size="30" />      
      (a confirmation e-mail will be sent to this address) </td>
    </tr>
    <tr>
      <td class="label">Guest Phone Number:</td>
      <td><label>
        <input name="phone" type="text" id="phone" value="<?php echo htmlspecialchars($phone); ?>">
      </label></td>
    </tr>
   
    <tr>
      <td class="label"><label for="body">Confirmation email that goes to guest<br>
       
      :</label></td>
      <td><textarea name="body" id="body" cols="70" rows="5">Thanks for confirming your attendance to our tuesday night open house. We look forward to meeting you. Please go to the following link for further instructions and directions to our office. Again we look forward to meeting you.
 
 <?php echo htmlspecialchars($body); ?>
 
Thanks Again
Denise Adkins
Director of Operations
Global Financial Advisors
       
      </textarea></td>
    </tr>
    <tr><td id="submit" colspan="2"><button type="submit" onclick="MM_popupMsg('Please make sure you are clear on instructions. Make sure guest email is filled out properly so that your guest received the rsvp email. Corey will recieve a copy of this and call your invitee accordingly.')">Send Confirmation</button></td></tr>
  </table>
  <input type="hidden" name="MM_insert" value="bopconfirmation">
</form>
<?php
    }
?>
 
There are still quite a few issues in there, probably the most important one being the way you are setting $crack. Each line is going to overwrite the previous, effectively meaning that only the last test is actually going to return a result.

Anyhow ... take a look and see if it's any clearer this way.
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

Okay I completely re-wrote the script. This is my first time writing by myself. surprise surprise there is a error. I tried to make the code very clear.

Code: Select all

<?php require_once('../Connections/spartanwisdom.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bopconfirmation")) {
  $insertSQL = sprintf("INSERT INTO BOPConfirmation (`Date`, AgentCode, AgentName, GuestName, GuestEmail, GuestPhone, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['bopdate'], "text"),
                       GetSQLValueString($_POST['agentemail'], "text"),
                       GetSQLValueString($_POST['agentname'], "text"),
                       GetSQLValueString($_POST['guestname'], "text"),
                       GetSQLValueString($_POST['guestemail'], "text"),
                       GetSQLValueString($_POST['guestphone'], "text"),
                       GetSQLValueString($_POST['message'], "text"));
 
  mysql_select_db($database_spartanwisdom, $spartanwisdom);
  $Result1 = mysql_query($insertSQL, $spartanwisdom) or die(mysql_error());
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
<form id="bopconfirmation" name="bopconfirmation" method="POST" action="<?php echo $editFormAction; ?>">
  <table width="609" height="391" border="0" align="center">
    <tr>
      <td>Agent Name:</td>
      <td><label>
        <input type="text" name="agentname" id="agentname" />
      </label></td>
    </tr>
    <tr>
      <td>Agent Email:</td>
      <td><label>
        <input type="text" name="agentemail" id="agentemail" />
      </label></td>
    </tr>
    <tr>
      <td>Date of BOP Attending:</td>
      <td><label>
        <input type="text" name="bopdate" id="bopdate" />
      </label></td>
    </tr>
    <tr>
      <td>Guest Name:</td>
      <td><label>
        <input type="text" name="guestname" id="guestname" />
      </label></td>
    </tr>
    <tr>
      <td>Guest Email:</td>
      <td><label>
        <input type="text" name="guestemail" id="guestemail" />
      </label></td>
    </tr>
    <tr>
      <td>Guest Phone:</td>
      <td><label>
        <input type="text" name="guestphone" id="guestphone" />
      </label></td>
    </tr>
    <tr>
      <td>Message to be sent to guest:</td>
      <td><label>
        <textarea name="message" id="message" cols="45" rows="5"></textarea>
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="submitconfirmation" id="submitconfirmation" value="Submit Confirmation" />
      </label></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="bopconfirmation" />
</form>
 
<?php
// on submit the emails will be sent to all of the following emails 
$admin_email = 'deniseadkins83@gmail.com, coreylesage@gmail.com, joeadkinswlg@gmail.com';
$agent_email = $_POST ['agentemail'];
$guest_email = $_POST ['guestemail'];
 
// all emails will come from the following email address
$from_email = 'info@spartanwisdom.com';
 
// the following code is the email that is sent to the admin (corey,denise,joe)
 
$adminsubject = 'New BOP Confirmation';
$adminmessagebody = $_POST ['agentname']. "has just added a new invite to the list for follow up the information
for the new invite is below."
        " Date of Presentation Attending:" $_POST ['bopdate'] 
        " Name of Guest to Confirm:" $_POST ['guestname'] 
        " Email for the Confirmed Guest: " $_POST ['guestemail'] 
        " Phone number for Guest to confirm:" $_POST ['guestphone'] 
        " Any special Instructions for agent:" $_POST ['message'] 
        
"Please make sure that the guest receives a confirmation phone call the day before the presentation. Also know that 
they have received a confirmation email as well";
 
//the following is the email that the potential guest will receive
 
$guestsubject = 'Tuesday Night Presentation Confirmation';
$guestmessagebody = $_POST ['guestname']. 
"We look forward to meeting you on Tuesday night at our presentation." $_POST ['agentname']. "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information." 
"<a href = http://www.spartanwisdom.com/followup/b ... dayof.html>"
 
//the following is the email that the agent will recieve
 
$agentsubject = 'Tuesday Night Presentation Confirmation';
$agentmessagebody = " Thank you for entering your potential guests information into our presentation confirmation system. Please note that a confirmation call will also be made to your guest the day before the presentation. Your guest received the following email:" 
$_POST ['guestname']. 
"We look forward to meeting you on Tuesday night at our presentation." $_POST ['agentname']. "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information." 
"<a href = http://www.spartanwisdom.com/followup/b ... dayof.html>"
 
// the following code will be if the agent inputing the confirmation does not fill out a text box 
 
if (!$_POST ['agentname']) {
    echo "You must enter the agents name who invited the guest.";
    exit;
    }
if (!$_POST ['agentemail']) {
    echo "You must enter your email address to receive the confirmation.";
    exit;
    }
if (!$_POST ['bopdate']) {
    echo "You must enter the date of the presentation your guess will be attending for confirmation.";
    exit;
    }
if (!$_POST ['guestname']) {
    echo "You must enter the name of the guest to be followed up with.";
    exit;
    }
if (!$_POST ['guestemail']) {
    echo "You must enter a email address for the guest so they can receive the email rsvp confirmation.";
    exit;
    }
if (!$_POST ['guestphone']) {
    echo "You must enter the guest's phone number so that we can have a confirmation call made.";
    exit;
    }
    
mail($admin_email,$adminsubject,$adminmessagebody, 'From:'$from_email.);
mail($agent_email, $agentsubject,$agentmessagebody,'From:'$from_email.);
mail($guest_email, $guestsubject, $guestmessagebody,'From:'$from_email.);
 
echo "Your Confirmation for" $_POST['guestname']" has been made. Please click below to be re-directed to our main page. <br/>
    <a href= http://www.spartanwisdom.com/agent.php>";
    
exit;
 
?>
 
</body>
</html>
I am going nuts here please help
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

oh yeah here is the error I am getting.. I just don't see where I am making my mistake


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /hermes/bosweb/web026/b263/sl.necee8483/public_html/test/test4.php on line 126
drfeelgood
Forum Newbie
Posts: 15
Joined: Mon Sep 01, 2008 9:57 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by drfeelgood »

Please try this :

$adminmessagebody = $_POST ['agentname']. "has just added a new invite to the list for follow up the information
for the new invite is below.";
$adminmessagebody =. " Date of Presentation Attending:" . $_POST ['bopdate'];
$adminmessagebody =. " Name of Guest to Confirm:" . $_POST ['guestname'];
$adminmessagebody =. " Email for the Confirmed Guest: " . $_POST ['guestemail'];
$adminmessagebody =. " Phone number for Guest to confirm:" . $_POST ['guestphone'];
$adminmessagebody =. " Any special Instructions for agent:" . $_POST ['message'];
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

thanks I will try that right now :)
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

Okay I tried that and thanks for that I do see that mistake now. However I am still getting a similar error. A little different but here it is :

Parse error: syntax error, unexpected '.' in /hermes/bosweb/web026/b263/sl.necee8483/public_html/test/test4.php on line 126

Below is the changed code:

Code: Select all

<?php require_once('../Connections/spartanwisdom.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bopconfirmation")) {
  $insertSQL = sprintf("INSERT INTO BOPConfirmation (`Date`, AgentCode, AgentName, GuestName, GuestEmail, GuestPhone, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['bopdate'], "text"),
                       GetSQLValueString($_POST['agentemail'], "text"),
                       GetSQLValueString($_POST['agentname'], "text"),
                       GetSQLValueString($_POST['guestname'], "text"),
                       GetSQLValueString($_POST['guestemail'], "text"),
                       GetSQLValueString($_POST['guestphone'], "text"),
                       GetSQLValueString($_POST['message'], "text"));
 
  mysql_select_db($database_spartanwisdom, $spartanwisdom);
  $Result1 = mysql_query($insertSQL, $spartanwisdom) or die(mysql_error());
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
<form id="bopconfirmation" name="bopconfirmation" method="POST" action="test4.php">
  <table width="609" height="391" border="0" align="center">
    <tr>
      <td>Agent Name:</td>
      <td><label>
        <input type="text" name="agentname" id="agentname" />
      </label></td>
    </tr>
    <tr>
      <td>Agent Email:</td>
      <td><label>
        <input type="text" name="agentemail" id="agentemail" />
      </label></td>
    </tr>
    <tr>
      <td>Date of BOP Attending:</td>
      <td><label>
        <input name="bopdate" type="text" id="bopdate" />
      </label></td>
    </tr>
    <tr>
      <td>Guest Name:</td>
      <td><label>
        <input type="text" name="guestname" id="guestname" />
      </label></td>
    </tr>
    <tr>
      <td>Guest Email:</td>
      <td><label>
        <input type="text" name="guestemail" id="guestemail" />
      </label></td>
    </tr>
    <tr>
      <td>Guest Phone:</td>
      <td><label>
        <input type="text" name="guestphone" id="guestphone" />
      </label></td>
    </tr>
    <tr>
      <td>Message to be sent to guest:</td>
      <td><label>
        <textarea name="message" id="message" cols="45" rows="5"></textarea>
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="submitconfirmation" id="submitconfirmation" value="Submit Confirmation" />
      </label></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="bopconfirmation" />
</form>
 
<?php
// on submit the emails will be sent to all of the following emails 
$admin_email = 'deniseadkins83@gmail.com, coreylesage@gmail.com, joeadkinswlg@gmail.com';
$agent_email = $_POST ['agentemail'];
$guest_email = $_POST ['guestemail'];
 
// all emails will come from the following email address
$from_email = 'info@spartanwisdom.com';
 
// the following code is the email that is sent to the admin (corey,denise,joe)
 
$adminsubject = 'New BOP Confirmation';
$adminmessagebody = $_POST ['agentname']. "has just added a new invite to the list for follow up the information
for the new invite is below.";
$adminmessagebody =. " Date of Presentation Attending:" .$_POST ['bopdate'];
$adminmessagebody =. " Name of Guest to Confirm:" . $_POST ['guestname'];
$adminmessagebody =. " Email for the Confirmed Guest: " . $_POST ['guestemail'];
$adminmessagebody =. " Phone number for Guest to confirm:" . $_POST ['guestphone'];
$adminmessagebody =. " Any special Instructions for agent:" . $_POST ['message'];
        
"Please make sure that the guest receives a confirmation phone call the day before the presentation. Also know that 
they have received a confirmation email as well");
 
//the following is the email that the potential guest will receive
 
$guestsubject = 'Tuesday Night Presentation Confirmation';
$guestmessagebody = $_POST ['guestname']. 
"We look forward to meeting you on Tuesday night at our presentation." $_POST ['agentname']. "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information." 
"<a href = http://www.spartanwisdom.com/followup/b ... dayof.html>"
 
//the following is the email that the agent will recieve
 
$agentsubject = 'Tuesday Night Presentation Confirmation';
$agentmessagebody = " Thank you for entering your potential guests information into our presentation confirmation system. Please note that a confirmation call will also be made to your guest the day before the presentation. Your guest received the following email:" 
$_POST ['guestname']. 
"We look forward to meeting you on Tuesday night at our presentation." $_POST ['agentname']. "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information." 
"<a href = http://www.spartanwisdom.com/followup/b ... dayof.html>"
 
// the following code will be if the agent inputing the confirmation does not fill out a text box 
 
if (!$_POST ['agentname']) {
    echo "You must enter the agents name who invited the guest.";
    exit;
    }
if (!$_POST ['agentemail']) {
    echo "You must enter your email address to receive the confirmation.";
    exit;
    }
if (!$_POST ['bopdate']) {
    echo "You must enter the date of the presentation your guess will be attending for confirmation.";
    exit;
    }
if (!$_POST ['guestname']) {
    echo "You must enter the name of the guest to be followed up with.";
    exit;
    }
if (!$_POST ['guestemail']) {
    echo "You must enter a email address for the guest so they can receive the email rsvp confirmation.";
    exit;
    }
if (!$_POST ['guestphone']) {
    echo "You must enter the guest's phone number so that we can have a confirmation call made.";
    exit;
    }
    
mail($admin_email,$adminsubject,$adminmessagebody, 'From:'$from_email.);
mail($agent_email, $agentsubject,$agentmessagebody,'From:'$from_email.);
mail($guest_email, $guestsubject, $guestmessagebody,'From:'$from_email.);
 
echo "Your Confirmation for" $_POST['guestname']" has been made. Please click below to be re-directed to our main page. <br/>
    <a href= http://www.spartanwisdom.com/agent.php>";
    
exit;
 
?>
 
</body>
</html>
 
drfeelgood
Forum Newbie
Posts: 15
Joined: Mon Sep 01, 2008 9:57 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by drfeelgood »

I've made some changes. please try this and b4 that backup your file.
===============================================================


"Please make sure that the guest receives a confirmation phone call the day before the presentation. Also know that
they have received a confirmation email as well";

//the following is the email that the potential guest will receive

$guestsubject = 'Tuesday Night Presentation Confirmation';
$guestmessagebody = $_POST ['guestname'].
"We look forward to meeting you on Tuesday night at our presentation.". $_POST ['agentname']. "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information."
"<a href = http://www.spartanwisdom.com/followup/b ... dayof.html>"

//the following is the email that the agent will recieve

$agentsubject = 'Tuesday Night Presentation Confirmation';
$agentmessagebody = " Thank you for entering your potential guests information into our presentation confirmation system. Please note that a confirmation call will also be made to your guest the day before the presentation. Your guest received the following email:". $_POST['guestname']. "We look forward to meeting you on Tuesday night at our presentation.".$_POST ['agentname']. "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information.<a href = http://www.spartanwisdom.com/followup/b ... dayof.html>";

// the following code will be if the agent inputing the confirmation does not fill out a text box

if (!$_POST ['agentname']) {
echo "You must enter the agents name who invited the guest.";
exit;
}
if (!$_POST ['agentemail']) {
echo "You must enter your email address to receive the confirmation.";
exit;
}
if (!$_POST ['bopdate']) {
echo "You must enter the date of the presentation your guess will be attending for confirmation.";
exit;
}
if (!$_POST ['guestname']) {
echo "You must enter the name of the guest to be followed up with.";
exit;
}
if (!$_POST ['guestemail']) {
echo "You must enter a email address for the guest so they can receive the email rsvp confirmation.";
exit;
}
if (!$_POST ['guestphone']) {
echo "You must enter the guest's phone number so that we can have a confirmation call made.";
exit;
}

mail($admin_email,$adminsubject,$adminmessagebody, 'From:'$from_email.);
mail($agent_email, $agentsubject,$agentmessagebody,'From:'$from_email.);
mail($guest_email, $guestsubject, $guestmessagebody,'From:'$from_email.);

echo "Your Confirmation for". $_POST['guestname']." has been made. Please click below to be re-directed to our main page. <br/>
<a href= http://www.spartanwisdom.com/agent.php>";

exit;
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

scratch that.. I have fixed all errors and am down to one of the last :

Parse error: syntax error, unexpected T_VARIABLE in /hermes/bosweb/web026/b263/sl.necee8483/public_html/test/test4.php on line 180

mail script error I am having trouble with. Same code as above
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

thanks so much. error free except for mail script.. your all my heros :)
drfeelgood
Forum Newbie
Posts: 15
Joined: Mon Sep 01, 2008 9:57 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by drfeelgood »

please try this for sendmail ...

mail($admin_email, $adminsubject, $adminmessagebody, 'From:'.$from_email);
mail($agent_email, $agentsubject, $agentmessagebody, 'From:'.$from_email);
mail($guest_email, $guestsubject, $guestmessagebody, 'From:'.$from_email);

echo "Your Confirmation for". $_POST['guestname']." has been made. Please click below to be re-directed to our main page. <br/><a href= http://www.spartanwisdom.com/agent.php>";

exit;
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

wooo hoo it works :) I just have some simple grammar errors I have to go fix. Now one thing I am completely missing is a code to change the sender of the emails. Have any idea where to start there ? It comes from : sl.necee8483@boscgil1703... which i am sure is something through my server so i guess i have to write a code to mask this..
necee8483
Forum Newbie
Posts: 20
Joined: Mon Nov 03, 2008 3:09 pm

Re: mail/confirmation help I'm at your mercy ! :(

Post by necee8483 »

okay now my emails go out effectively the code is functioning. I have some errors I am having trouble finding a solution for.

1st: My email address shows up as sl.necee8483@..... I want to mask with with another email address but I am not sure how to write the code for this.

2nd: To make the emails a little more easily readable I tried using the <br/> to put the information on different lines in the email but it all seems to run together. and I get the following error:


Parse error: syntax error, unexpected '<' in /hermes/bosweb/web026/b263/sl.necee8483/public_html/test/test4.php on line 124

So I took the <br/> tags back out is there anthor tag I should be using ? or a should I just play with the white space ?

I have placed the code for just the mail function that I wrote below. Thanks for any help in advance I really appreciate it.

Code: Select all

<?php
// on submit the emails will be sent to all of the following emails 
$admin_email = 'deniseadkins83@gmail.com, coreylesage@gmail.com, joeadkinswlg@gmail.com';
$agent_email = $_POST ['agentemail'];
$guest_email = $_POST ['guestemail'];
 
// all emails will come from the following email address
$from_email = 'info@spartanwisdom.com';
 
// the following code is the email that is sent to the admin (corey,denise,joe)
$adminsubject = 'New BOP Confirmation';
$adminmessagebody = $_POST ['agentname']. "has just added a new invite to the list for follow up the information
for the new invite is below." ;
 
$adminmessagebody .= " Date of Presentation Attending: " . $_POST ['bopdate'] ; 
$adminmessagebody .= " Name of Guest to Confirm: " . $_POST ['guestname'];
$adminmessagebody .= " Email for the Confirmed Guest: " . $_POST ['guestemail'];
$adminmessagebody .= " Phone number for Guest to confirm: " . $_POST ['guestphone'];
$adminmessagebody .= " Any special Instructions for agent: " . $_POST ['message'];
$adminmessagebody .= "Please make sure that the guest receives a confirmation phone call the day before the presentation. Also know that they have received a confirmation email as well";
 
//the following is the email that the potential guest will receive
 
$guestsubject = 'Tuesday Night Presentation Confirmation';
$guestmessagebody = $_POST ['guestname']. "We look forward to meeting you on Tuesday night at our presentation." ;
 
$guestmessagebody .= ($_POST ['agentname']) . "wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information. " ;
$guestmessagebody .= "www.spartanwisdom.com/followup/bop/invitedtobop/bopinvitevideodayof.html ";
$guestmessagebody .= ($_POST ['agentname']) ;
$guestmessagebody .=  "Regional Director" ;
$guestmessagebody .= "Global Financial Advisors";
 
 
//the following is the email that the agent will recieve
 
$agentsubject = 'Tuesday Night Presentation Confirmation';
$agentmessagebody = " Thank you for entering your potential guests information into our presentation confirmation system. Please note that a confirmation call will also be made to your guest the day before the presentation. Your guest received the following email: " ;
 
$agnetmessagebody .= ($_POST ['guestname']). 
" We look forward to meeting you on Tuesday night at our presentation. " ;
$agentmessagebody .= ($_POST ['agentname']). " wanted to make sure that you received a confirmation email with any special instructions and directions to our office here in Altamonte Springs. Please click on the link below to be re-directed to our website to receive all the appropriate information. "; 
$agentmessagebody .= " http://www.spartanwisdom.com/followup/b ... dayof.html ";
$agentmessagebody .= "Denise Adkins";
$agentmessagebody .= "Director of Operations" ;
$agentmessagebody .= "Global Financial Advisors" ;
 
 
// the following code will be if the agent inputing the confirmation does not fill out a text box 
 
if (!$_POST ['agentname']) {
    echo "";
    exit;
    }
if (!$_POST ['agentemail']) {
    echo "You must enter your email address to receive the confirmation.";
    exit;
    }
if (!$_POST ['bopdate']) {
    echo "You must enter the date of the presentation your guess will be attending for confirmation.";
    exit;
    }
if (!$_POST ['guestname']) {
    echo "You must enter the name of the guest to be followed up with.";
    exit;
    }
if (!$_POST ['guestemail']) {
    echo "You must enter a email address for the guest so they can receive the email rsvp confirmation.";
    exit;
    }
if (!$_POST ['guestphone']) {
    echo "You must enter the guest's phone number so that we can have a confirmation call made.";
 
 
    exit;
}
    
mail($admin_email,$adminsubject,$adminmessagebody,$from_email);
mail($agent_email, $agentsubject,$agentmessagebody,$from_email);
mail($guest_email, $guestsubject,$guestmessagebody,$from_email);
 
echo "Your Confirmation for " .  $_POST['guestname']." has been made.";
    
exit;
 
?>
Post Reply