SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Sessions

  1. #1
    SitePoint Enthusiast Z_A_D's Avatar
    Join Date
    Jan 2002
    Location
    New Zealand
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Sessions

    Hi

    I have a site set up on a lan. I am using Apache/Php4/MySql. I have been working through Kevins book, and things are going ok.

    I have decided to use sessions and have written some pages that include
    PHP Code:
    <?php session_start(); ?> ...
     
    <?php if ( !isset($uid) ): ?>
          <script language="JavaScript" type="text/JavaScript">
             window.Location = "index.php?url=<?php echo($PHP_SELF); ?>"
          </script>
       <?php endif; ?>
    Everything worked fine the first time, but it seems that whenever I click on a protected page now (as above) I am no longer redirected to the login page (index.php).
    This is the case even though I delete the session file, close the browser, and reboot the client and the server.

    I am a little confused about this.

    TIA

    Z_A_D

  2. #2
    SitePoint Enthusiast Z_A_D's Avatar
    Join Date
    Jan 2002
    Location
    New Zealand
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    It's OK you can stop looking I've found it!

    The problem was the spaces each side of the '=' after the word javascript.

    Z_A_D

  3. #3
    SitePoint Enthusiast Z_A_D's Avatar
    Join Date
    Jan 2002
    Location
    New Zealand
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OOps I mean after the word location


Bookmarks

Posting Permissions

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