Thankyou, thankyou, thankyou.
You have added the last piece to this puzzle which has taken me 4 days so far!
I really appreciate it.
One other question. So this random value [token] is there an easy way that I can put it wherever I want on my vB site. So perhaps If I want to display this to people on the homepage in the corner (or on a thankyou page after they post a message) I could add something smaller than the whole code.
If I could stick
<?php
$result
?>
Into the html of the page and have it show the result of the full code then that would be awesome.
I guess something would be needed in the "php includes"
---------
NEWS: I found the answer and other newbs may find it useful so here it is:
In the phpinclude_start template through the admin cp, include the following:
ob_start();
include_once('path/to/yourphppage.php');
$variable = ob_get_contents();
ob_end_clean();
Now you can add as many of these groups of code into the phpincludes_start template just change the yourpage.php and $variable names.
Then just upload your php page. And then insert $variable into your other templates which publish the html and $variable is converted into the result of the .php file.
Very clever stuff and it means you can just add $variable wherever you want the result to appear.
It feels good to finally start to understand all of this