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

  • Home
  • SEARCH
  • 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 8321901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:11:03+00:00 2026-06-08T23:11:03+00:00

Simply put: <? include(open.php); ?> VS <? include(open.php?page=about); ?> VS <? $x=varToPass; include(open.php); ?>

  • 0

Simply put:

<? include("open.php"); ?>

VS

<? include("open.php?page=about"); ?>

VS

<? $x="varToPass"; include("open.php"); ?>

Why can this not be done, surely this should have been programmed into. And if not can I edit the raw/core PHP C files to achieve 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-06-08T23:11:04+00:00Added an answer on June 8, 2026 at 11:11 pm

    The simple answer. There is no need to pass parameters like this.

    include 'open.php?page=about&something=true&more=rubbish';

    versus

    $page = 'about';
    $something = true;
    $more = 'rubbish';
    
    include 'open.php';
    

    I think it’s quite easy to see which is more readable, and they both achieve exactly what you are trying to do.

    The fact is that the include statement literally includes the code from the indicated file at the point you reference it.

    You can treat the file doing the including, as having the source of open.php at the exact place you wrote the include statement.

    Edit:

    To answer the second part of your question. Yes you could modify the source and achieve this, but it would be a largely pointless exercise.

    Edit 2:

    It has also occurred to me that perhaps you think you want to include files by URL.

    For example include 'http://127.0.0.1/open.php?page=about'

    In this case it is completely possible, as the http stream wrapper will be invoked, and variables will be passed to the file you requested.

    This behaviour is DISABLED BY DEFAULT BECAUSE IT POSES A MASSIVE SECURITY RISK.

    You can turn it on by editing the allow_url_include value in php.ini. But I suggest that you don’t.

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

Sidebar

Related Questions

I can't seem to get back on track with this one. I simply put
Simply put I want what http://www.reddit.com/ and http://news.ycombinator.com/ have to the left of every
Simply put, I'm getting this error in the Product Admin of Magento after adding
Am I missing something completely. How can we simply put the value in definition
Simply put, I want to override ProcessController which is in the Mage/Index/controllers/Admninhtml/ProcessController.php. I know
I have a new project which simply put, is an attempt to formalize the
I have a script of calling KCFinder. window.open('/kcfinder/browse.php?type=files', ...); it must open a window
Simply put, I'd like to be able to convert any string to an integer,
Simply put: What is the most effective way to share / reuse code between
Simply put I'm trying to sync two slideshows created using widgetkit lib in a

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.