Jump to content

Recommended Posts

Goal: I am trying to create a flat-file array that will allow me to edit any variable for an entire Website from one setup.php page.

 

I create a file called 'setup.php' wherein the array looks like this:

 

<?php
          $setup['1']='page file path or other variable';
          $setup['2']='page file path or other variable';
          $setup['3']='page file path or other variable';
?>

 

Then, I included this in the page HEAD where a variable needs to be changed:

 

<?php require("setup.php"); ?>

 

 

Problem:  Where I'm getting lost is what to insert inside the page file in place of where I would usually hard-code the file or object reference, ESPECIALLY IF I WANT TO PULL-IN A PATH TO A FILE. When I use:

 

<?php echo $setup['1'] ?>

 

....all I see in my webpage is "page file path or other variable" (without quotes), but what I NEED to see is the actual file that I would normally see would I have used a traditional standalone PHP include. In other words, my setup.php file is really just going to be a list of files to include.  Hypothetically (though shown incorrectly here for demonstration purposes), I need an execution like this...

 

<?php
          $setup['1']='<?php include("http://www.whatever01.php"); ?>';
          $setup['2']='<?php include("http://www.whatever02.php"); ?>';
          $setup['3']='<?php include("http://www.whatever03.php"); ?>';
?>

 

 

I can only hope I explained this correctly.

 

Anyone's prompt assistance is greatly appreciated.

 

-Jet-

 

-

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.