Right got rid of that error - and am now seeing an ID being populated in the campaign manager.
I'm not however seeing a ref URL being shown in the subscribe success page.
The code now looks like:
<?php
session_start();
$share_url = (isset($_GET['subscribe']) && isset($_SESSION['name'])) ? 'http://www.argadnel.com?ref='.$_SESSION['name'] : '' ;
$referid = (isset($_GET['ref'])) ? $_GET['ref'] : '';
if (!isset($_SESSION['name'])) {
$_SESSION['name'] = '';
$chars = '23456789bcdfghjkmnpqrstvwxyz';
for ($n=0; $n<6; $n++) {
$_SESSION['name'] .= $chars[mt_rand(0, strlen($chars)-1)];
}
}
?>
and the form looks like:
<!-- Campaign Monitor subscribe form begins -->
<form action="http://argadnel.createsend.com/t/r/s/qjhtdi/" method="post" id="subForm">
<label for="qjhtdi-qjhtdi">Email:</label><br /><input type="text" value="Email address" onFocus="this.value=''" onBlur="if(this.value==''){this.value='Email address'}" name="cm-qjhtdi-qjhtdi" id="qjhtdi-qjhtdi" />
<!-- Edited CM form code, featuring session & referrer IDs -->
<input type="hidden" name="cm-f-bihft" id="name" value="<?php echo $_SESSION['name']; ?>" />
<input type="hidden" name="cm-f-bihfi" id="ref" value="<?php echo $referid?>" />
<input type="submit" value="subscribe" />
</form>
</div>