nriddock
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_em ail'];
$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_emai l']."
project_mgr_phone: ".$_POST['project_mgr_phon e']."
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,"Fr om: supportoffice\r\nCc: $cc_mail,$cc_mail2,$cc_mai l3\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_emai l']."
project_mgr_phone: ".$_POST['project_mgr_phon e']."
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_STR ING'])) {
$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
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
$cc_mail = $_POST['project_mgr_email'
$cc_mail2 = $_POST['project_sponsor_em
$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']
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_emai
project_mgr_phone: ".$_POST['project_mgr_phon
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,"Fr
/*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_emai
project_mgr_phone: ".$_POST['project_mgr_phon
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_STR
$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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tried option 2
gving me: Parse error: parse error in /var/www/html/php/insert.p hp on line 101
this corresponds to </html> ... the last line of the file
gving me: Parse error: parse error in /var/www/html/php/insert.p
this corresponds to </html> ... the last line of the file
Can you post the code?
echo '<META HTTP-EQUIV="refresh" CONTENT="10;URL='.$locatio n.'">';
i think you are missing some ;
ASKER
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
the curly brace under $location was missing
$location = sprintf("%s", $updateGoTo);
}
after i fixed that it worked great...thx for all your help
$message = stripslashes($message);
to
$message = '\r\n\r\n' . stripslashes($message);