No problem.. simple.
When you've created your random $memid on the 2nd page, just below it, put
$_SESSION['memid'] = $memid;
This session variable is now set for every page the browser visits until he closes the browser. In other words, you no longer have to send it in the URL so the...