Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:11:28+00:00 2026-05-25T12:11:28+00:00

I have a jqtouch website depending on if someone is logged in or not

  • 0

I have a jqtouch website depending on if someone is logged in or not the pages change. At the moment I have a pretty ugly solution….

 function page1()
 {
     $page1 = '<div>.........</div>';
     return $page1;
 }

 function page2()
 {
     $page2 = '<div>.........</div>';
     return $page2;
 }

 function page3()
 {
     $page3 = '<div>.........</div>';
     return page3();
 }

etc….

to load the page I do the following

 echo page1() . page2() . page3();

or

 echo page1() . page3();

Depending on what the user state is.

I need to mix and match pages so I have all the pages in one main page and only really want to run the sql withing those pages should they be needed.

effectively I have a stack of cards and I want to put them together in various ways with out disturbing the unrequired ones.

How would you assemble the pages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:11:29+00:00Added an answer on May 25, 2026 at 12:11 pm

    Use templates:

    In page1.php

    <div>You are logged in!</div>
    include_once("common2.php");
    <div>Do you want to logout?</div>
    

    In page2.php

    <div>Please login first!/div>
    include_once("common2.php");
    <div><a href="#">Login Here</a></div>
    

    In common.php

    <div>This is common to all pages</div>
    

    In common2.php

    <div>
      This is common to all pages but 
      it appears in the middle of the content of page1 and page 2
    </div>
    

    Then in your gateway page you do this:

    include_once("common.tpl");
    
    if($userIsLoggedIn)
    {
      include_once("page1.tpl");
    }
    else
    {
      include_once("page2.tpl");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a iphone site based on JQTouch. When the pages are not wrapped
I have a website designed for the android browser using jquery/jqtouch. As a part
I have an IPAD compatible website that contains some staic html pages and some
After getting pretty far along with a jQTouch web application for our website, my
Hiiii I have a jQtouch site in dev and i would like to use
I'm building a small website with JQTouch and the first problem I've run into
I use jqtouch and I have an iframe in one of the divs that
I have a rails app with a mobile view using jqtouch. If the application
I've just recently started developing a site for iPhone using jQTouch, and have the
I looked at the documentation of jqtouch but I could not figure out how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.