include site setting for php values one 1 page

selvol used Ask the Experts™
I am having some trouble including 1 file containing php values used throughout my site.

I want to just put


Open in new window

on top of all pages instead of the complete code.

I have tried using the "include" function a few ways.
But I want to include some $_GET values and the dont seem to be passed.

Here is an example of what I would like to have in the include file

$fname =  ucwords(strtolower($_GET['fname'])) ;
 $lname =  ucwords(strtolower($_GET['lname'])) ;

Open in new window

Any suggestion are appreciated.
Thank you Selvol
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try adding the function to the like below code and call them with every page where you include the above file

hope that helps, thanks


function preprocessvalues($fname,$lname){
     $arr = array();
     $arr['fname'] =  ucwords(strtolower($fname)) ;
      $arr['lname'] =  ucwords(strtolower($lname)) ;
      return $arr;

// now try calling the function after including the above file to page with below
// some page.php
$arr = preprocessvalues($_GET['fname'],$_GET['lname']); // process the array 

Open in new window


Thank you.
That shortens it some.
and explains why it would not work.

Anyway to set those values like a "global" would work?

i.e. in the php.ini?


Got it..........

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial