dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: loading 2 different pages on index page

  1. #1
    Join Date
    Aug 2012
    Posts
    1

    loading 2 different pages on index page

    I wrote a code that checks for session set which will require(inner.php) if session is set and if not, it should require(login.php)but my jquery and javascripts are not working though i included all the javascripts for the two pages on the index.php

  2. #2
    Join Date
    Jun 2006
    Location
    Under your bed
    Posts
    357
    Could you post your code?

  3. #3
    Join Date
    Aug 2012
    Location
    Belgium
    Posts
    66

    This would be better done in php...

    index.php

    <?php
    if(!isset($_SESSION['foo'])){
    header('location: login.php');
    }
    else{
    include('inner.php');
    }
    ?>

    ensures your redirections will work even without js

  4. #4
    Join Date
    May 2011
    Location
    With Hobbits
    Posts
    125
    Quote Originally Posted by Gudlife View Post
    index.php

    <?php
    if(!isset($_SESSION['foo'])){
    header('location: login.php');
    }
    else{
    include('inner.php');
    }
    ?>

    ensures your redirections will work even without js
    So what is not working, the Redirect to Login.php or the inner.php Include, or both?

  5. #5
    Join Date
    Mar 2007
    Location
    Canada
    Posts
    99
    make sure you put exit(); after the redirect code (location).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles