View Single Post
  #3 (permalink)  
Old 07-13-03, 06:05 AM
paulj000 paulj000 is offline
Bull in a china shop
 
Join Date: Jul 2003
Location: California, USA
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry for the lack of clarity on that! The variables represent the
changing content for each page of my site. Every page has the
same variables but with different contents to them.

Here is what I am attempting in my newbie-half-baked way.
Every page on my small site is composed of 4 variables: $content, $bodybg, $lcolpad and $title.

example page code for my /experience/index.php page
might look like this:

PHP Code:

$content '<div id="title">

<script language="JavaScript" type="text/javascript" src="/_includes/js/h1_experience.js"></script>
<noscript><img src="/_images/titles/experience.gif"></noscript>
<h1>%metaDesc%</h1></div>

<p>
I have done all sorts of work for different blah blah blah etc etc </p>'
;

$bodybg 'none';
$lcolpad '40';
$title 'Experience in show business';

/*code below that I do not want to be processed on my forms 
page but is necessary on each web page to "pull" the html 
template and a few other functions and combine with my above 
variables so I can output a real html page to the site visitor*/

$dir getcwd();
$os substr_replace($dir''2);
if (
$os == "J:") {$osRoot "J:/Apache2/htdocs/";}
else {
$osRoot "/home/domain/public_html/";}

/* contains code to file_get_contents of html template and substr_replace 
things like %content% with $content etc*/
include ($osRoot."_includes/php/logic_pre_html.inc.php");
?> 

I am trying to learn how to make a simple cms tool where you
type in the URL of a file on my server, press submit and up comes a form with 4 textareas, each displaying one of the variables. You can re-type the stuff and press save and it then rewrites the old
page with the new variables contents. I know other people have done this better and the site is so small I dont really need a PHP
form to edit pages cuz' there are only about 15 pages total anyway. It's basically a learning tool for me.

Anyhow when I include(); a page it not only puts the variables into each textarea (yay!) but it also process the code on the bottom and ends up displaying the entire html template and all (bad...).

Thanks for your reply SleeperZ
Reply With Quote