Jump to content

Recommended Posts

Posted

I have been working on converting an .asp script connected to a webform I inherited to PHP.

 

I think I have done it, but am confused by these lines in the old .asp script:

 

<%

ON Error resume next

set email=Server.CreateObject("JMail.Message")

 

How would these translate in PHP? Are they necessary? I hve copied them at the top of the PHP script below (lines 2 and 3).

 

 

<?

ON Error resume next

set email=Server.CreateObject("JMail.Message")[/color]

$email->Logging=true;

$email->From="edudevfacmedcourses@imperial.ac.uk";

$email->FromName="On-Line Booking";

$email->AddRecipient("edudevfacmedcourses@imperial.ac.uk");

$email->subject=strtoupper($_POST["surname"]).", ".$_POST["workshop_title"].", ".$_POST["nhsjobtitle"].", ".$_POST["division"].", ".$_POST["nhstrust"].", ".$_POST["hospitalorganisation"];

$email->body="______________________________________________________\r\n";

$email->body.="WORKSHOP DETAILS\r\n";

$email->body.="______________________________________________________\r\n";

$email->body.="Title:".$_POST["workshop_title"]."\r\n";

$email->body.="Date:".$_POST["workshop_date"]."\r\n";

$email->body.="Teaching Imperial students:".$_POST["teachingstudents"]."\r\n";

$email->body.="\r\n";

$email->body.="______________________________________________________\r\n";

$email->body.="PARTICIPANT DETAILS\r\n";

$email->body.="______________________________________________________\r\n";

$email->body.="CID:".$_POST["cid"]."\r\n";

$email->body.="Probationer lecturer:".$_POST["prob_lect"]."\r\n";

$email->body.="Probation end date:".$_POST["probation_expiry"]."\r\n";

$email->body.="Title:".$_POST["participant_title"]."\r\n";

$email->body.="Forename:".$_POST["forename"]."\r\n";

$email->body.="Surname:".$_POST["surname"]."\r\n";

$email->body.="NHS Job title:".$_POST["nhsjobtitle"]."\r\n";

$email->body.="NHS Trust:".$_POST["nhstrust"]."\r\n";

$email->body.="Hospital/Organisation:".$_POST["hospitalorganisation"]."\r\n";

$email->body.="Division:".$_POST["division"]."\r\n";

$email->body.="Department and/or Speciality:".$_POST["department"]."\r\n";

$email->body.="Telephone number:".$_POST["tel_no"]."\r\n";

$email->body.="Email:".$_POST["email"]."\r\n";

$email->body.="Work address:".$_POST["work_address"]."\r\n";

$email->body.="Special requirements:".$_POST["requirements"]."\r\n";

$email->body.="\r\n";

$email->body.="______________________________________________________\r\n";

$email->body.="PAYMENT DETAILS\r\n";

$email->body.="______________________________________________________\r\n";

$email->body.="Payment name:".$_POST["payment_name"]."\r\n";

$email->body.="Payment address:".$_POST["payment_address"]."\r\n";

$email->body.="Payment telephone number:".$_POST["payment_telno"]."\r\n";

$email->body.="Payment email:".$_POST["payment_email"]."\r\n";

$email->Send["mhs-relay.ic.ac.uk"];

$email->close;

if ((Err->Number > 0))

{

header("Location: http://www.imperial.ac.uk/edudev/bookingforms/formfailure"); // WARNING: assuming Err is an external function

}

else

{

header("Location: http://www.imperial.ac.uk/edudev/bookingforms/formsuccess");

}

?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...