Jump to content

I need serious help with a simple flat array PLEASE


JetJagger

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-

 

-

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.