Link to home
Start Free TrialLog in
Avatar of nriddock
nriddockFlag for United States of America

asked on

php confirmation page

i currently have a DWMX master/detail set that allows me to insert a record, email the contents of the submitted record and then return to the main screen. I am trying to implement a "confirmation page" in between the email and the redirect to main page.

i reused a version of the "email content" section to print to the screen the post data but i keep getting header output errors.

  /*PHP STARTS HERE */

//the email to send this msg to
$firstline = $_POST['project_number'];
$getme = $_POST['approver_signature']; //populated from the 2 layer dropdown
$cc_mail = $_POST['project_mgr_email'];
$cc_mail2 = $_POST['project_sponsor_email'];
$cc_mail3 = $_POST['requestor_email'];
$get_this_approval = $_POST['appID'];


$general_mailbox = $getme;
//format the message with your data
$message="
Approval Request# ".$_POST['appID']." for Project# ".$_POST['project_number']." has been ".$_POST['disposition'].".

If you wish to submit an appeal please visit the intranet Approval Appeal Process.
http://mysite.com/update.php?recordID=$get_this_approval

=============================================================================
                     Approval Form
=============================================================================
project_mgr:                   ".$_POST['project_mgr']."
project_number:                   ".$_POST['project_number']."
project_mgr_email:             ".$_POST['project_mgr_email']."
project_mgr_phone:             ".$_POST['project_mgr_phone']."
request_date:                   ".$_POST['request_date']."

Code: APPF02";

//get any dodgy characters out of the message for sending
$message = stripslashes($message);

//send the email
mail("$general_mailbox", "$firstline - Approval Form - Decision Notification",$message,"From: supportoffice\r\nCc: $cc_mail,$cc_mail2,$cc_mail3\r\n");
/*PHP ENDS HERE */



  /*PHP STARTS HERE */

//format the message with your data
$message="
============================================
                     Approval Form
============================================
project_mgr:                   ".$_POST['project_mgr']."
project_number:                   ".$_POST['project_number']."
project_mgr_email:             ".$_POST['project_mgr_email']."
project_mgr_phone:             ".$_POST['project_mgr_phone']."
request_date:                   ".$_POST['request_date']."

Code: APPF02";

//get any dodgy characters out of the message for sending
$message = stripslashes($message);

//print the content
print "$message";
/*PHP ENDS HERE */

  $updateGoTo = "main_menu.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}
 //////////////////////////////////////////

so im guessing that i may need a different method of displaying the submitted data  / confirmation page. i thought of just passing the record ID and displaying the "detail page" for that newly submitted record but at the time of submission there is no recordID for the record...thus no go.

any suggestions? thanks
Avatar of Bernard Savonet
Bernard Savonet
Flag of France image

Just to be sure that there is the required empty line between the header and the body, I would probably change
$message = stripslashes($message);

to
$message = '\r\n\r\n' . stripslashes($message);
ASKER CERTIFIED SOLUTION
Avatar of Muhammad Wasif
Muhammad Wasif
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nriddock

ASKER

tried option 2
gving me: Parse error: parse error in /var/www/html/php/insert.php on line 101

this corresponds to </html> ...  the last line of the file
Can you post the code?
echo '<META HTTP-EQUIV="refresh" CONTENT="10;URL='.$location.'">';
i think you are missing some ;
figured out what was causing the Parse error..

the curly brace under $location was missing

  $location = sprintf("%s", $updateGoTo);
}

after i fixed that it worked great...thx for all your help