Announcement

Collapse
No announcement yet.

[SOLVED]Form does not execute PHP in production

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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.

  • #2
    Silly question perhaps, but is your db in production the same as under development?
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      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.

      Comment


      • #4
        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.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Thanks for your sharing!

          Comment


          • #6
            Hello,

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

            regards,
            Bernhard

            Comment


            • #7
              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.

              Comment


              • #8
                Thanks for your feedback!

                Comment

                Working...
                X