1 Reply Latest reply on Feb 27, 2008 8:13 AM by Günter Schenk

    submiting a form to its self <?=$_SERVER['PHP_SELF']?>

      Hi, I'm using a custom transaction for a form that is eamiling the results and everythin works fine but i want to submit the form to it's self and change the displaying elements. i have tried to put <?=$_SERVER['PHP_SELF']?> in the action form settings as well as in the re-direct

      if (!$_POST['submit'])
      {
      ?>
      My form starts here
      <?php
      }
      else
      {
      $thenamefield = $_POST['firstName'];
      echo 'Thanks $thenamefield';
      }
      ?>
      I get no errors and the email sends ok but the form is still their and the thankyou message does not show. is this possible with the custom trans to detect the post?
        • 1. Re: submiting a form to its self <?=$_SERVER['PHP_SELF']?>
          Günter Schenk Level 4
          Hi Robert,

          ADDT´s default form action does already submit to itself, so changing that to $_SERVER['PHP_SELF'] won´t help.

          ----
          I get no errors and the email sends ok but the form is still their
          ----

          It might well be that the ADDT forms don´t know how to handle the $_POST['submit'] condition when being "reloaded"

          ------
          is this possible with the custom trans to detect the post?
          ------

          I´d rather suggest having the custom transaction detect a certain transaction value: getColumnValue("column_name") -- don´t think that ADDT´s transaction "engine" is capable of detecting if a form has been submitted or not.

          However, as you assumingly just want to display the submitted "firstName" value, I´d rather suggest to pass the corresponding "dynamic data" to the redirect page (thanks.php?firstname={firstName}) and display it there ($_GET['firstname'])

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver