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

PHP Echo in Fieldlabel / Value field?


  1. 84R
    Member

    Hi again everyone!

    I´ve stumpled upon a new problem... :-D ( You´ll always learn new things everyday... )

    Ive got a problem with a kinda complicated thing with the form...

    First you log in to a 'identification' page and then it forwards you to the order form, and in the form Im trying to do an <?php echo "$_REQUEST[switch]" ?> command in the Default value field and lock it so just an admin can view it ( so it could be sent me in a Email, but the problem is that it dosent work like the html links I´ve asked about before, it just writes out <?php echo "$_REQUEST[switch]" ?> instead of the switchname.

    Im sure that the command is right, but how do I get the echo command to work as an php command?

    Or is there any thing I could do with the mail thats being sent to me instead?
    ( tried the echo thingy there to but no luck... )

    Sorry for my poor English!

    Best Regards

    Charlie.

    Posted 16 years ago #
  2. yuniar

    Hi Charlie,

    Can you paste me your code please?


    MachForm Founder

    Posted 16 years ago #
  3. 84R
    Member

    <?php echo "$_REQUEST[switch]" ?>

    Thats the code, I just want the result of the command to show in the field or in the mail that has been sent, but it dosent work as an php command it just prints the text as a text <?php echo "$_REQUEST[switch]" ?>.

    The html commands worked like a charm! But is there anyway to do so with php commands?

    Posted 16 years ago #
  4. yuniar

    Instead of using that code, use only this code:

    {$_REQUEST[switch]}

    make sure to have those curly brackets.


    MachForm Founder

    Posted 16 years ago #
  5. 84R
    Member

    Hi yuniar!

    Ive tried that now for a couple of times, but no luck so far, Ive tried to put it in the Mail, Field Text and Field Label but it dosent work...

    Maybe I should make a new "field" with just like you made all the single line text, and so on, and include the echo in there instead...

    Posted 16 years ago #
  6. yuniar

    Ah.. I see.
    So you are pasting the code from the form builder?

    I'm afraid that won't work. Field label and field value doesn't accept any PHP code indeed.

    You need to modify the PHP code directly to do this (which I thought you did this one).

    Edit your "includes/view-functions.php" file. Search for display_text() function and put the necessary code there.


    MachForm Founder

    Posted 15 years ago #

RSS feed for this topic

Reply