Crea tu documento html llamalo como quieras , el ref tiene que ir asi
tu_pagina.html?ref=referencia
Código HTML:
<html>
<head>
<script type="text/javascript">
function ref(){
var text = document.location.href;
var ref = text.split('=')[1];
document.getElementById("referido").value = ref;
}
</script>
<title>REF con html y javascript</title></head>
<body onLoad="ref()">
<p>
<form action="send.php" method="post" name="form2" class="Estilo6" id="form2">
<table width="245" height="326" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="36" colspan="2" align="center" class="Estilo31"><p> </p>
<p></p></td>
</tr>
<tr>
<td width="62" height="22" class="Estilo31"><div align="left"><span class="Estilo28"><strong>Nombre</strong>: </span></div></td>
<td width="183" class="Estilo31"><div align="left">
<input name="name" type="text" id="name" size="29" />
</div></td>
</tr>
<tr>
<td height="22" class="Estilo33">Referido por </td>
<td class="Estilo31"><input name="referido" type="text" id="referido" size="29" /></td>
</tr>
<tr>
<td height="22" class="Estilo31"><div align="left"><span class="Estilo28"><strong>E-mail</strong>:</span></div></td>
<td class="Estilo31"><div align="left">
<input name="email" type="text" id="email" size="29" />
</div></td>
</tr>
<tr>
<td height="200" colspan="2" class="Estilo31">
<br />
<span class="Estilo28"><strong>Mensaje</strong>:<br />
<textarea name="message" cols="38" rows="10" id="message"></textarea>
</span>
<p> </p></td></tr>
<tr>
<td height="24" colspan="2" align="center" class="Estilo31"><span class="Estilo32">
<input name="enviar" type="submit" class="Estilo32" id="enviar" value="Enviar" />
</span></td>
</tr>
</table>
</form>
</body>
</html>
Prueba con eso espero que te sirva