The project runs fine on my development machine. But on the webserver, one of the pages gets its oncreate fire up about 50 times and then a button gets pressed automatically. That was my first impression. But I realise now that something is just caching the last state of the form (and its not the browser as it doesnt happen locally and I have cleared its cache).
How can I prevent this ?
<?php
require_once("vcl/vcl.inc.php");
use_unit("forms.inc.php");
use_unit("stdctrls.inc.php");
use_unit("comctrls.inc.php");
//Class definition
class frm_Sign_Up extends Page
{
public $lbl = null;
public $cbx = null;
public $lblHdr = null;
public $btnSignUp = null;
public $btnCancel = null;
function frm_Sign_UpCreate($sender, $params)
{
// Populate Combobox
$this->Populate();
}
function Populate()
{
// Count number of times Create is run
$this->cbx->AddItem($this->cbx->Count);
}
function btnSignUpClick($sender, $params)
{
// Display it
$Error = 'x';
if ($Error <> '')
{
$this->lbl->Caption = 'Pressed '.$this->cbx->Count;
$this->lbl->Visible = true;
return (false);
}
else
{
redirect ('app_main.php');
exit;
}
}
}
global $application;
global $frm_Sign_Up;
//Creates the form
$frm_Sign_Up=new frm_Sign_Up($application);
//Read from resource file
$frm_Sign_Up->loadResource(__FILE__);
//Shows the form
$frm_Sign_Up->show();
?>