Forum Moderators: coopster
I need your keen eyes to figure out what is happening here
I have an OOP script that works well on two local test servers
One runs a slightly older PHP, the other one the last PHP just before release of PHP5, in both cases it runs with Reg Glob off, as it should
How is it built:
One) A class that reads a template, sets values, and sends info to a browser.
That class I have used many times and I know it does not cause any trouble
Two) a templates
Using the following
<!--{PROD_1}--> no problems here!
Three) the main page
<<
require_once ("../DB conn etc..."); // Include the configuration file.
require_once ("../classes/the class I mentioned in “One”.class"); // Include the class.
$id=1;
$page = again the “One” class ("../templates/main_template_products.inc.php"); // Create an instance.
$content_1 .= '';
include "../includes/prod_1.inc.php";
$page->SetParameter("PROD_1", $content_1);
and my include file
<?
$conn = db_connect();
$sql= "select prod_1 from XXXXX where id=$id";
$result = mysql_query($sql,$conn);
while ($new_content=mysql_fetch_array($result) ){
$content_1.= $new_content[prod_1];
}
?>
I am pretty sure that the scripts has no fault
It works on another production server
So what can go wrong
Up to the point of getting a full blank page that in “view source” shows 100% of nothing!
I know the DB conn fine since I can edit it via my CMS using the same db conn function
Will that be a server setting?
It runs with reg glob on and safe mode on
and the answer is NO
but please be with me, exactly at the same root level
I have my authentication, admin, and update, del etc.. cms system that use the same DB connection classes
and works OK
Last news:
the host asked me to try instead of ../connect script to use /pub/user/.... path to my connection files
and THEN IT WORKS
I am glad it does but why in that OOP environment
and only on that server there is such a requirement
knowing that on another server it works fine
the answer is that I start to run too many sites
and timing to consider a dedicated server seems perfect.
Great I will face more problems!
again thank you
Henry
include_path. That way you can just include() your files, and never have to worry about the path. You'll set it once when you setup a new site and be done with it. A lot of programmers use this technique, you'll often see it called the "config.php" script or something similar. I've added a sample to the latest Bag o' Tricks [webmasterworld.com] thread.