SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Login script

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Login script

    Ok don't shoot me, I'm trying to use a pre-made login script for a site that I'm playing with. I will learn how to code one in future, but right now I want to play & learn other more basic stuff.

    Anyway, I downloaded this script http://www.evolt.org/node/60384 Which is cool, it does everything I need. However, its a pain to make pages with it since all the html has to go inside an else statement and therefore all the figgin tags have to be escaped.
    PHP Code:
    include("include/session.php");

    if(
    $session->logged_in){
      echo 
    "All your html & any other php!";
    }
    else{
      echo 
    "You are not allowed to view this page";
    }
    ?> 
    With the previous version, I could just paste an include at the top of each page I wanted to protect and that was it.

    Anyone know how I can get around it, or know of another login script with a 'forgot password' function that will allow me to just paste an include at the top of the protected pages?

    Thanks

  2. #2
    SitePoint Zealot Zurev's Avatar
    Join Date
    Feb 2009
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Might be missing something but why don't you just...
    PHP Code:
    include("include/session.php");



    if(!
    $session->logged_in){

      die(
    'Not logged in');


    Then have the rest of your code after that, that way they see your code if it gets there.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Duh yeh of course who needs else!! Thanks mate


Tags for this Thread

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
  •