Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13

Thread: logout problem

  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts

    Smile logout problem

    hello
    Hope all well

    My site http://bumblebeechat.net does not seems to logout in IE works perfit in chrome and firefox but not IE I dont understand why can anyone work it out

    this is the logout code
    Code:
    <? require('header.php'); ?>
    
    
    <table width="99%" align="center">
      <tr>
        <td><table width="100%" height="100%">
          <tr>
            <td width="49%"><strong>YOU ARE NOW BEENING LOGED OUT</strong></td>
            </tr>
          <tr>
            <td><div align="justify"><?	 	 
    if ($session->logged_in) { 
    ?>
    
    <script language="JavaScript">
    <!--
    
    window.location="process.php";
    
    //-->
    </script>
    
    <? } else { ?>
    How are you able to logout while your not even logged in?<br />
    Doh!<br /><br />
    <? include ('loginblank.php'); ?>
    
    <? } ?>
    </div></td>
            </tr>
        </table></td>
      </tr>
    </table>
    <br />
    <br />
        <? require('footer.php') ?>
    and then in the process.php

    Code:
       function procLogout(){
          global $session;
          $retval = $session->logout();
          header("Location: index.php");
       }
    and then the session.php

    Code:
      function logout(){
          global $database;  //The database connection
          /**
           * Delete cookies - the time must be in the past,
           * so just negate what you added when creating the
           * cookie.
           */
          if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){
             setcookie("cookname", "", time()-COOKIE_EXPIRE, COOKIE_PATH);
             setcookie("cookid",   "", time()-COOKIE_EXPIRE, COOKIE_PATH);
          }
    
          /* Unset PHP session variables */
          unset($_SESSION['username']);
          unset($_SESSION['userid']);
    	   unset($_SESSION['userlevel']);
    
          /* Reflect fact that user has logged out */
          $this->logged_in = false;
          
          /**
           * Remove from active users table and add to
           * active guests tables.
           */
          $database->removeActiveUser($this->email);
          $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time);
          
          /* Set user level to guest */
          $this->email  = GUEST_NAME;
          $this->userlevel = GUEST_LEVEL;
       }
    it a real puzzle to me

    Many Thanks for Replys

  • #2
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,371
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    How do you log out? Is there a button or link somewhere? Show us that part also.

  • #3
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    ok

    Code:
    <p class="bring"><? if ($session->logged_in) {  ?> Welcome <?=$username;?>!  <? } ?><? if ($session->logged_in) {  ?><a href="signout.php" title="Sign Out Yor Account" >Sign Out</a><? } else { ?></p>
      <?	 	 
    if ($session->logged_in ) { 
    if($_SESSION['userlevel'] == 3 ) {
    ?>
    <script language="JavaScript">
    <!--
    window.location="admin.php";
    //-->
    </script>
    <?php
    }
    else {
    ?>
    
    
    <script language="JavaScript">
    <!--
    window.location="welcome.php";
    //-->
    </script>
    <?
    }
    } else { ?>
    
    <p class="bring">Hello Guest Please <a href="signin.php" title="Login to Your Account" >Login</a> or <a href="register.php" title="Register an Account" >Register</a> an Account </p>
    
    <? } ?>
          <? } ?>
    Thank You

  • #4
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,371
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    I guess when I first looked at your website I didn't notice the problem right away ...

    Let's just look at this page as an example:

    http://www.bumblebeechat.net/

    When I view the HTML source, I see three webpages in one ... with the <html>, <!DOCTYPE html ...>, <body>, etc. That alone is a serious problem.

    I guess Chrome and Firefox are able to deal with that, but IE cannot. The fact of the matter is, there is something wrong with your website, or how you are generating your web pages. Whether it's static or dynamic, I don't know how you create your pages.

    You can't just mash together several web pages into one page ... it doesn't work that way. Just by looking at your site, how you fix this seems like you might have to start all over again from square one.



    .
    Last edited by mlseim; 03-09-2013 at 05:05 PM.

  • #5
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    what if I did it this way have the header start <html>, <!DOCTYPE html ...>, <body> then the footer ends it and nothing in beteen only the page title would that be ok ?

  • #6
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,371
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    Try it and see.

    How are you creating pages? By hand, or an editor, or dynamically?

  • #7
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    am using Dreamweaver

  • #8
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,371
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    I've never used Dreamweaver, but I'm surprised DW doesn't flag the multiple <html> tags, and the very fact that it lets you do what you did ... that surprises me.

    DW doesn't always make the best web sites. I think it adds too much "junk" to the scripting.

  • #9
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    what would you use?

  • #10
    New Coder
    Join Date
    Dec 2011
    Posts
    61
    Thanks
    4
    Thanked 10 Times in 10 Posts
    When I started out I used Notepad+ (I'm on a Windows computer), but you could use Dreamweaver. Just don't use of any of their fancy automated do-dads...use it as text editor until you are comfortable.

    Start by creating a new html page with HTML5 and use this as your building block
    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    </head>
    
    <body>
    </body>
    </html>
    Any Html stuff goes between the <body></body> tags and CSS can go in between <head></head> or <body></body> {if it's inline}. I generally have a template for my websites that I use with just the basic like the above (with a few modifications for I basically know what I'm going to use for every project beforehand). Myself, I wouldn't be using Dreamweaver if I didn't already have the accompanying Adobe Suite that I purchase, but I basically use it as a glorified text editor for I do all my typing myself.

  • #11
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    yeh but thing is I used a header then the main then a footer

    so the main always includes header and footer that why it 3 files

    so I thought I could do it this way
    header has the
    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    </head>
    <body>
    then main has
    Code:
    <head>
    <title>page name</title>
    </head>
    then the footer just ends it
    Code:
    </body>
    </html>

  • #12
    New to the CF scene
    Join Date
    Mar 2013
    Location
    India
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am agree with whatnot.

  • #13
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Hello find out something new that relate to the meta tags when you includes header and footer wish I find out sooner lol
    in my last post I put

    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    </head>
    <body>
    then main has
    Code:
    <head>
    <title>page name</title>
    </head>
    then the footer just ends it
    Code:
    </body>
    </html>

    but could do it this way
    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <title><?php echo $title; ?></title>
    <meta charset="utf-8">
    </head>
    <body>
    then the main
    Code:
    <?php $title = 'the title text'; ?>
    then the footer just ends it
    Code:
    </body>
    </html>
    but a question if I use in main
    Code:
    <?php $css = 'css/main'; ?>
    then add this to header tag
    Code:
      <link rel="stylesheet" href="<?php echo $css; ?>"
          type="text/css" media="screen" />
    would that be good or bad to do?
    would it work?

    Many Thanks for Replys


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •