Im trying to update the contents of an element after running some php code. I realize the php is executed first, but I thought by loading the page I could then find the element? However console says cannot find element of null so I guess the page isn’t loading before the innerHTML code is running.
Anyone any ideas?
else if(strlen($_POST['username']) < 6){
header("Location: http://webpage/register.html");
echo "document.getElementById('elemID').innerHTML = usename too short";
}
header()instructs your clients to go to the new location, hence outputting anything after that would make no effect to your client as the content of register.html is already handled differently by your server.If you can change register.html to use php instead, you could pass
Then in your register.php