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

Removing '\' when autopopulating form fields


  1. Trowar
    Member

    Hi,

    I have a form using the advanced integrated code.

    In my view-functions.php I use the below code to auto-poulate a field

    if ( $_GET['m'] <= 3 && $_GET['m'] >= 1 && $element->id == 5) {
    $element->populated_value['element_'.$element->id]['default_value'] = $_GET['d'];
    }

    If $_GET['d'] is equal to "l'ecran" then the field is populated with "l\'ecran".

    How to I cange my php code to import the value without adding the backslash in the process?

    Many Thanks,

    Peter.

    Posted 14 years ago #
  2. Trowar
    Member

    Figured it out. I didn't relaise it was the server that was making the changes...

    $element->populated_value['element_'.$element->id]['default_value'] = stripslashes($_GET['d']);

    Posted 14 years ago #

RSS feed for this topic

Reply