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 4575344
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:03:00+00:00 2026-05-21T20:03:00+00:00

I am withdrawing from the database a page name and putting into the this

  • 0

I am withdrawing from the database a page name and putting into the this equal statement:

 // Redirect if not there
 if ($db_client === $session_client) {
 require("custom.php");
 } else {
 require("general.php");
 }

So here, $db_client is the client id stored for a custom page and $session_client being the id in the session. If it matches it should take the user to custom.php and if not it should take them to general.php

For some reason PHP shows me both pages. general.php on top and custom.php at the bottom of the general.php

I am using this on general page:

  // If not page (path) is stored in db than show general
  if (empty($pagename)) {

   require_once("general.php");

  } else {
  require_once("$pagename");

  }

Any way to fix this?

  • 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-21T20:03:01+00:00Added an answer on May 21, 2026 at 8:03 pm

    The problem can be in a different place than you think. Especially since we know that general.php could be included in several places.

    So you need to get the actual order of includes to locate the problem.

    Option A. Install xdebug module and you’ll be able to get the log of every call.

    Option B is simpler. Write echo 'including-', <N>; before every require operator. <N> is the number, unique for every usage. So you’ll be able to know which operator caused the unwanted include.

    BTW. Isn’t require_once($pagename); better than require_once("$pagename");?
    And ensure $pagename variable is secured against the relative path attacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is a beginner's question: Every tutorial I've seen on CoreData focusses on database-backed
I'm following this tutorial attempting to learn XNA, but I'm having issues making my
I am learning Java from scratch. I installed the JDK, and I got the
I am trying to get some data from xml file from my C# coding.
Again, I am a java n00b and I am trying to learn from scratch
There's a problem with drawing gridlines in listview with common controls 6. It happens
After reading a tutorial of Flash, I am still not sure what exactly is
I have following properties in my current Account Balance object: long id; // Database
Let's say I have a table named transaction with transaction_date, deposit, withdrawal fields. There
After receving some help from another very helpful member I'm stuck at another point

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.