Ok, I got the url to match contact-us-whatever%20I want but it will only work if I use a - character to separate each capture. Not sure why.
So now I want to capture the data, but I think I'm barking up the wrong tree here. This works so far, but what if the user posts a - character in their email address or their message? That will knacker my contact us script. 
PHP Code:
$url = $_SERVER['REQUEST_URI'];
$url = str_replace (SITE,'',$url);
preg_match('/^contact-us-(?P<fname>[a-zA-Z]+)-(?P<sname>[a-zA-Z]+)-(?P<message>.*+)/',$url,$matches);
print_r ($matches);
// contact-us-Joe-Bloggs-anything I want here!!)(*&^
// returns
// Array ( [0] => contact-us-Joe-Bloggs-anything%20I%20want%20here!!)(*&%5E [fname] => Joe [1] => Joe [sname] => Bloggs [2] => Bloggs [message] => anything%20I%20want%20here!!)(*&%5E [3] => anything%20I%20want%20here!!)(*&%5E )
But for some reason if I add in -(?P<email>.*+) before the message, the script doesn't work.
Bookmarks