Retrieve formname

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bigfoot

    Retrieve formname

    Hi,

    In my PHP script I want to put the name of the form, i'm currently in, into
    a variable.

    So far I haven't found an answer!

    Greetz,

    Bigfoot


  • Pedro

    #2
    Re: Retrieve formname

    Bigfoot wrote:[color=blue]
    >In my PHP script I want to put the name of the form, i'm currently in, into
    >a variable.[/color]

    Make your form send its name to the php script using a hidden
    input field (line 4):

    1 <html><head><ti tle>form name</title></head>
    2 <body>
    3 <form name="testform" action="xyz.php " method="post">
    4 <input type="hidden" name="formname" value="testform " />
    5 bla bla bla <input type="text" name="input1" /> bla bla bla
    6 <input type="submit" value="TEST ME!" />
    7 </form>
    8 </body></html>

    and in xyz.php
    <?php
    $submitted_form = $_POST['formname'];
    ?>


    --
    "Yes, I'm positive."
    "Are you sure?"
    "Help, somebody has stolen one of my electrons!"
    Two atoms are talking:

    Comment

    • Bigfoot

      #3
      Re: Retrieve formname

      > Make your form send its name to the php script using a hidden[color=blue]
      > input field (line 4):
      >
      > 1 <html><head><ti tle>form name</title></head>
      > 2 <body>
      > 3 <form name="testform" action="xyz.php " method="post">
      > 4 <input type="hidden" name="formname" value="testform " />
      > 5 bla bla bla <input type="text" name="input1" /> bla bla bla
      > 6 <input type="submit" value="TEST ME!" />
      > 7 </form>
      > 8 </body></html>
      >
      > and in xyz.php
      > <?php
      > $submitted_form = $_POST['formname'];
      > ?>[/color]

      Thanx mate!


      Comment

      Working...