Call function from a <form>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeni
    New Member
    • Aug 2006
    • 5

    Call function from a <form>

    Can anyone tell me if it is possible to call a function from a php form (which use html),
    where the function is included in a class in another php file..

    <?php
    echo "<pre><form method=\"post\" action=\="what do I write here to acces function test()">";

    echo "<input type="text" name="tekst">";
    echo"<input type="submit" value="send">";
    </form>
    ?>

    <?php
    function test(){
    echo $tekst;
    }
    ?>


    Regards Jeni
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    This is not possible in the way you describe, all php code runs server side but the form runs client side.

    You have to provide a link to a new php script (or the same one) and as the server serves the script it is run with any data from the form.

    Comment

    Working...