Question

The '?subject' and '&body' especially..

urlAddress = mailAddress+"?subject=" +mailSubject+"&body="+mailBody;
Was it helpful?

Solution

The question mark denotes the start of parameters you are passing to the script. Subject is the first parameter. The '=' denotes an assignment, meaning subjects value is going to be whatever is in mailSubject. The ampersand denotes the start of a new parameter, in this case "body." Body's value will be whatever is in mailBody. You denote any number of new parameters to pass with more ampersands, for example:

someurl.com/somescript.php?parameter1=somevalue&parameter2=othervalue&parameter3=anothervalue
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top