I'm working on an online exam site. So when a user submits the registration form on my site, the user must be directed to 'url/accesscode'. Here, the accesscode variable must be sent to the URL from the database when the form is submitted. A new access code is to be sent for every new registration.
How can I accomplish this using javascript/PHP?
I tried to concatenate url using javascript, also tried hidden inputs on forms, but these will work for only single access code.
Method1 - Javascript
var aCode=“accesscode”
function onClick()
{
window.open("url"+aCode);
};
Method2 - HTML
<form action="URL" method="GET">
<input type="hidden" name="access_code" value="accesscode">
<?form>