Adding Features to the Hotspot Webpages

"I’ve got to run a separate external webserver and use the PHP API to do this. "
This is what you need, it does not require any physical change or NAT configuration for the customer

i.e deploy your portal on your website http://wifi.mfrater.com
on the RB751, change the login.html file to something like

<html>
<head>
<title>Please wait</title>

<body onload='connexion.submit()'>

<h2 align=center><i>Please wait</i></h2>

<form name='connexion' action='http://wifi.mfrater.com' method='post'>
  <input type='hidden' name='sip' value='$(server-address)'>
  <input type='hidden' name='uip' value='$(ip)'>
  <input type="hidden" name="linkOrig" value="$(link-orig)">
  <input type="hidden" name="erreur" value="$(error)">
</form>

</body></html>

This way your users will be automatically redirected on your online captive portal and you will be able to do what you want. Look at the files generated by default in the RB751 hotspot directory to understand how login/logout works. Don’t forget to put wifi.mfrater.com in the walled garden.