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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:33:22+00:00 2026-06-03T06:33:22+00:00

Is this secure including? Or is it possible to use some RFI/LFI or what’s

  • 0

Is this secure including? Or is it possible to use some RFI/LFI or what’s it called?

$request_uri = explode('/', $_SERVER['REQUEST_URI']);
$script_name = explode('/', $_SERVER['SCRIPT_NAME']);

for ($i = 0; $i < sizeof($script_name); $i++) {
    if ($request_uri[$i] == $script_name[$i])
    {
        unset($request_uri[$i]);
    }
}

$command = array_values($request_uri);

if (file_exists('controllers/' . $command[0] . '.php')) {
    include 'controllers/' . $command[0] . '.php';
}

update:

if (isset($_GET['p'])) {
    $pages = array('home', 'login', 'register');
    $page = filter_var($_GET['p'], FILTER_SANITIZE_URL);

    if (in_array($page, $pages) && file_exists($page . '.php')) {
        include ($page . '.php');
    } else {
        include ('404.php');
    }  
}
else {
    include ('home.php');
}
  • 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-06-03T06:33:24+00:00Added an answer on June 3, 2026 at 6:33 am

    Your code feeds any arbitrary string provided by the user to PHP’s include; this is bad and pretty much a textbook example of https://www.owasp.org/index.php/Server-Side_Includes_(SSI)_Injection

    What problem are you trying to solve that requires this?

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

Sidebar

Related Questions

After having this issue on our websites over secure SSL connections for Office file
I just need to secure my WF services. Can't find any resources on this.
We need to secure a multi-langual web application with SSL (registration, login,..). However, this
I didnt find anything according this issue. Can jaas be used to secure my
This should be a simple one: I have an observableArray object called To in
I've seen some other posts on this, but it appears that when i do
Several sites, including this one, are using OpenID to authenticate their users. And of
I have this piece of code: private function grabCurrentUser() { $this->id = parent::secure($_GET['cid']); $params
I have a little Sinatra app including this module: module Sprockets module Helpers def
according to this question all HTTP header when we are using HTTPS are encrypted(including

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.