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?
    The better I get at programming, the more I appreciate arrays. Handy dandy things they are.

  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?
    Albert Einstein ~ "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."

    Things To help you on this Site

    1. Place all php code in [php] Tags
    2. Place all html code in [html] Tags
    3. Remember to mark all your Threads Resolved using thead tools at the top when your problem is solved

  5. #5
    Join Date
    Mar 2007
    Location
    Canada
    Posts
    99

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