Report Information








$to_email = "reference@chemeketa.edu"; //email you want forms to go to $from_email = "reference@chemeketa.edu"; //email you want students to receive their copy of the form from / reply-to $form_url = "https://library-dev.chemeketa.edu/library-services/borrower-services/primo-problem-report-form/"; //url of this php page itself $error_url = "https://library-dev.chemeketa.edu/library-services/borrower-services/primo-problem-report-error/"; //url of a page where you can send them if something goes wrong /* Report Information */ $Name = isset($_POST['Name']) ? urldecode($_POST['Name']) : ''; $Email = isset($_POST['Email']) ? urldecode($_POST['Email']) : ''; $Problem_type = isset($_POST['Problem_type']) ? urldecode($_POST['Problem_type']) : ''; $Comment = isset($_POST['Comment']) ? urldecode($_POST['Comment']) : ''; $DocID = isset($_POST['DOCID']) ? urldecode($_POST['DOCID']) : (isset($_GET['permalink_path']) ? urldecode($_GET['permalink_path']) : ''); $zip_code = isset($_POST['zip_code']) ? urldecode($_POST['zip_code']) : ''; /* Email information */ $Formname = isset($_POST['Formname']) ? urldecode($_POST['Formname']) : ''; $Copy = isset($_POST['Copy']) ? urldecode($_POST['Copy']) : ''; $Submit = isset($_POST['Submit']) ? urldecode($_POST['Submit']) : ''; /* Deal with form submission */ if ($Formname!='' && $Submit === 'Submit') { if ($Name==''|$Email==''||$Problem_type=='') { echo "

Please fill out all required fields.

"; } elseif ($zip_code!=='') { echo "

Thank you for submitting your problem report.





"; } else { /* Email it */ $request = ""; $request .= "\r\n==Requester Information==\r\n"; $request .= "Name: " . $Name . "\r\n"; $request .= "Email: " . $Email . "\r\n"; $request .= "Problem_type: " . $Problem_type . "\r\n"; $request .= "Comment: " . $Comment . "\r\n"; $request .= "Primo Document ID: " . $DocID . "\r\n"; $headers = 'From: ' . $from_email . "\r\n"; if ($Copy != '') { $headers .= 'CC: ' . $Email . "\r\n"; } else { $headers .= 'Reply-To: ' . $Email . "\r\n"; } $headers .= 'X-Mailer: PHP/' . phpversion(); $subject = $Formname; /***** Additions for PHP MAILER code ****/ // the message //$msg = "First line of text\nSecond line of text"; // use wordwrap() if lines are longer than 70 characters //$msg = wordwrap($msg,70); $mail->setFrom('reference@chemeketa.edu', $Formname); $mail->addReplyTo($Email, $Name); //$mail->addAddress('paul.adarr@chemeketa.edu', 'Paul Adarr'); $mail->addAddress($to_email); if ($Copy != '') { $mail->addCC($Email, $Name); } $mail->Subject = $subject; //$mail->Body = <<Body = <<isHTML(false); /****************************************/ if (mail($to_email, $subject, $request, $headers)) { echo "

Your report has been sent with the details below.

"; } else { echo "

There was a problem sending your report. Please try again or contact us through another method.

"; } } } /* Emailing ends */