I have a script which grabs some variables then sends an email with a link and it all works fine
except for one annoying detail. I have a varibale "$courseName" which (guess what) holds he name of a course.
That name is always three or four words long i.e. "Tune In To Programs".
In the code below you'll notice the "print $linkToSend" - this prints the whole big link with the WHOLE course name,
but when the email arrives, the text is all printed as a link but only the first word of the course name is part of the link. Like this:

When clicked, this causes the page that the third party sees to display badly (wrong course name) so I'm wondering where I've gone wrong ?
All and any advice much appreciated.
Best wishes
Monty
My code to build the "$linkToSend" and send the email is this:
Code: Select all
$linkToSend = "http://www.SomeDomain.com/critique.php?student_id=".$id."&course_num=".$sub_course_num. "&courseName=" .$courseName;
print $linkToSend;
/////////// now send the email
$to = "$tutor_email";
$from = "admin@SomeDomain.com";
$subject = "Critique Required";
//Begin HTML Email Message
$message = "Hi $tutorFirstname,
A student on your course $courseName has uploaded their coursework and now requires a critique.
Please view their work by following this link:
$linkToSend
admin@SomeDomain.com";
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text\r\n";
mail($to, $subject, $message, $headers);