I need to extract some values from a URL, and then use these values to send an email.
Thanks to the kind of help on some others on here, I have nearly nailed it. The problem I am having is is that the url appendages look like this
?SessionID=582506&Note=joe@bloggs.com;joe bloggs;111.111.111.111&Status=203&Operator=
As you might have noticed the email address, name, amount and ip address are all stored in the note variable, separated by a semicolon.
Is there a way to parse the note value and extract the data (that is limited by semicolons) from it as separate quantities that I can then use in compiling an email?
Thanks in advance
Get the data from the Note
parameter, then split the value at semicolon (with e.g. explode
) and you can reach each part of the value in the resulting array.
$note = $_GET["Note"];
$note_parts = explode(";", $note);
$email = $note_parts[0];
$name = $note_parts[1];
$addr = $note_parts[2];