1 pointYou have PHP session code in a html page? is it setup to run php code in html document?
1 pointMissed ';' at end of echo statement
1 pointYou could use a sessionStorage variable to only open the popup once per session. I'd have to look into this in more detail later.