Using object in another page - and continuing the code in the page

Hi there,

I have this code in a page:


if($_POST['add_customer']):
$obj->add_customer($_POST);
endif;

For your information at the top of the page i have this code:



<?php
include("db.php");
include("CMS-class.php");

$obj = new test();

$obj->host='secure';
$obj->username ='secure';
$obj->password = 'secure';
$obj->db ='secure';

$obj->connect();
?>

So - you see it uses a class and function in the page CMS-class.php

The problem is when it goes to CMS-class.php the code in the page finishes! I have alot of code on the page below this bit of code:


if($_POST['add_customer']):
$obj->add_customer($_POST);
endif;

so why is it stopping?

Matt.

‘stopping’. Are you seeing the White Page Of Syntax Error?

I found the problem


include("CMS-class.php");

$obj = new test();

$obj->host='secure';
$obj->username ='secure';
$obj->password = 'secure';
$obj->db ='secure';

$obj->connect();

was not on the previous page. So obviously it needs it as well as on the page it redirects to. Strange but true.

Matt.