Hi,
I am a freelance website developer, and I am trying to build a "control panel" for my clients.
This is my situation:
I have all of the essential files on "my" server. I want to include my core files into the files on the client's server, so that every control panel uses the same files for formatting, among other things. In order to have client-specific control panels, I need to pass variables from the client's files into my files, before they are parsed and inserted into the client's files.
This might make more sense if you look at my code/files:
index.php (on client's server)
<?php
require("site_info.php");
require("http://www.mydomain.com/Control_Panel/header.php");
// Code specific to index.php
require("http://www.mydomain.com/Control_Panel/footer.php");
?>
site_info.php (on client's server)
<?php
$site_url = "http://www.clientdomain.com";
$site_name = "Client's Website's Name";
?>
Shortened version of header.php (on my server)
<html>
<head>
<title>Control Panel for <?php echo $site_name; ?></title>
</head>
<!-- rest of header.php code -->
Since header.php is parsed on my server before it is used my the client's server, $site_name is empty, and the output looks like this:
<html>
<head>
<title>Control Panel for </title>
</head>
<!-- rest of header.php code -->
I'm looking for a way to pass variables into my files before they are parsed. I've tried using session variables and they didn't work. I can't pass them as $_GET variables because I also need to pass MySQL information.
Is there any other way to include a file from a remote location, and use local variables inside the remote file?
thanks for taking the time to read through all of that,
Kyle
B&K Web Design Solutions