[SOLVED]Form does not execute PHP in production

I have a form with a php script as follows:

$doctitle ={doctitle};
$words = explode(" “,$doctitle);
$d = ‘’;
if(substr($doctitle,0,1)>=“0” and substr($doctitle,0,1)<=“9”){
$d = $words[0]; // New value
}
else{
$i=0;
while($i < count($words)) {
$d .=ucwords(substr($words[$i],0,1));
$i++;
}
}
$check_table = ‘idl’; // Table name
$check_where = “docid = '”.$d.”’"; // Where clause
$di = $d;
$i=0;
do{
$check_sql = ‘SELECT *’
. ’ FROM ’ . $check_table
. ’ WHERE ’ . $check_where;
sc_select(dataset, $check_sql);
if (false == {dataset})
{
// Error while accessing database
echo “Access error. Message =”. {dataset_error};
}
elseif ({dataset}->EOF)
{
// No record found
}
else
{
// Record found
$i++;
$di=$d.($i);
$check_where = “docid = '”.$di."’"; // Where clause
}
}while(!{dataset}->EOF);
$d=$di;
$master_field = ‘docid’; // Field name on the master application
$master_value = $d; // New value
// Set master value
sc_master_value($master_field, $master_value);

It works perfectly in scriptcase but when I deploy to the production server the script simple doesn’t work. Any help would be appreciated greatly.

Silly question perhaps, but is your db in production the same as under development?

It wasn’t exactly the same but I made it site same as the development, redeployed the form and it still doesn’t work. Works perfectly in scriptcase but does not display the calculated e in docid.

I still expect it to be a database issue. A first start could be adding debug echo’s (or write to file) to see where the script fails. Does it gets executed anyway? Where’s this code stored (event, libary) etc.

Thanks for your sharing!

Hello,

Please try to deploy under your development environment and let us know if the issue happens.

regards,
Bernhard

I solved this by replacing the line:
sc_master_value($master_field, $master_value);
With
{docid} = $d;
Now the docid field displays the calculated value correctly in scriptcase and my production environment.

Thanks for your feedback!