1👍
✅
this.userName
doesn’t exist.
You can also directly do this instead of passing by a variable :
window.location.href="successfullycreated.php?userName="+ <?php echo "'{$_GET['userName']}'";?>;
1👍
As long as the new page has the param present you can just get it from the URL in JavaScript.
var userName = new URL(window.location.href).searchParams.get("userName");
Source:stackexchange.com