Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About PHPremote

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Apparently, I have a line break within my innerHTML in a span tag with id=accountPanelTxt . I have to add a line break in a variable I am testing, as shown here. This is the resulting HTML, before the username innerHTML is altered: <span id="accountPanelTxt"> true</span> <span id="usernameTxt"> morenuts3</span> This is the Javascript: <script> alert("got here1b"); alert(document.getElementById("accountPanelTxt").innerHTML); loggedIn = document.getElementById("accountPanelTxt").innerHTML; alert("logged in: "+loggedIn); alert(document.getElementById("usernameTxt").innerHTML); var userName = document.getElementById("usernameTxt").innerHTML; alert("userName: "+userName); alert(document.getElementById("accountPanel").innerHTML); x = document.getElementById("accountPanelTxt").innerHTML; alert("x: "+x); z = 'true'; alert("z: "+z); y =''; menuTxt = ''; if (x == '\ntrue') { y = "T"; menuTxt = '<div class="dropdown"><button class="dropbtn">'+userName+'</button><div class="dropdowncontent"><a href="#">My Account</a><a href="#">My profile</a><a href="#">Profile Settings</a><a href="#">Notifications</a><br><a href="logout.php">Logout</a></div></div>'; } else { y= "F"; menuTxt = '<a href="indextemplate.php" id="loginlink">Login</a></td><td><a href="indextemplate.php" id="loginlink">Register</a>'; } alert(y); alert(menuTxt); document.getElementById("accountPanelTxt").innerHTML = menuTxt; alert("got here2b"); </script>
  2. I was also starting the session in my login script also, with an but that is not reliable. I have disabled that for now, but I doubt the session variables will always get passed as needed.
  3. Is Frihost still out there? I have not been able to log on even to the forum for a few days.
  4. I need an overall algorithm or sequence for login test using sessions. I am all turned around. I had to make up my own flowchart on paper. To access the username, for example, once the user is already logged in, I put a session_start() at the beginning of the site header script, called from within a page like "search.php". But to log in or out, I need to access it before that. I think I need to put session_start() at the beginning of each individual page. Passing variables like SESSION['validlogin'] seems to be haphazard, but I think that is a logic error somewhere. I was trying to make it really elegant before, with a single redirection script once logged in, but that was not working. So, back to basics.
  • Create New...