This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Hidden Fields not being populated


  1. vern1271
    Member

    I have 2 Hidden fields on a form. One to capture the referrer and the other for the page url...

    I put this in viewfunctions.php:

    //Form 9
                if($form_id == 16 && $row['element_id'] == 6){
                    $element[$j]->default_value = $HTTP_SERVER_VARS["HTTP_REFERER"];
                }
                if($form_id == 16 && $row['element_id'] == 7){
                    $element[$j]->default_value = $HTTP_SERVER_VARS['REQUEST_URI'];
                }

    but when I view the source on the front I see this:

    <li id="li_6" >
      <label class="description" for="element_6"> </label>
      <div>
      <input id="element_6" name="element_6" class="element text small" type="text" value="" />
      </div>
      </li>
       <li id="li_7" >
      <label class="description" for="element_7"> </label>
       <div>
      <input id="element_7" name="element_7" class="element text small" type="text" value="" />
      </div>
       </li>

    Now I know the $HTTP_SERVER_VARS["HTTP_REFERER"]; should be empty since i hit the page stright on, but I'm not getting the $HTTP_SERVER_VARS['REQUEST_URI'];

    I've tried using <?php echo $HTTP_SERVER_VARS['REQUEST_URI']; ?> on a blank page and it works that way.

    What am I doing wrong?

    Posted 14 years ago #
  2. yuniar

    Sorry for delayed response!

    Are you using the standard form code or advanced?


    MachForm Founder

    Posted 14 years ago #
  3. vern1271
    Member

    I'm using the advanced. Thanks.

    Posted 14 years ago #
  4. yuniar

    If you are using the advanced code, make sure to put your code above inside "display_integrated_form()" function.

    The code should be placed around line 2021.


    MachForm Founder

    Posted 14 years ago #
  5. vern1271
    Member

    OK, tried that... still not working.

    Posted 14 years ago #
  6. yuniar

    I see that you've submitted a ticket. We'll reply there.


    MachForm Founder

    Posted 14 years ago #

RSS feed for this topic

Reply