Results 1 to 4 of 4

Thread: dynamic form

  1. #1
    Join Date
    May 2002
    Posts
    4

    Question Unanswered: dynamic form

    hi there..
    i'm the new in php.now, i'm on developing payroll system using php........

    can u give the some samples how to create dynamic form, that have the buttons like Add, Edit and Delete?

    and how're the commands?

    i'm not clear in this topic.plz help me

  2. #2
    Join Date
    Nov 2001
    Posts
    12
    Something like tihis:
    <?php
    if ("Add" == $insert) {
    ////// put your sql statement here
    }
    ?>

    <form action="<?php echo($PHP_SELF); ?>" name="form1" method="post">
    <input type="text" name="description" size="40" >
    <p>
    <input type=submit name="insert" value="Add">
    </p>
    </form>

    So the form calls itself when the Add button is pressed and does the trick. And sameway with the others...

    -Petri-

  3. #3
    Join Date
    May 2002
    Posts
    4

    Question PHP_SELF

    hi there...

    may i know what is PHP_SELF?
    it's using for what?

  4. #4
    Join Date
    Nov 2001
    Posts
    12
    $PHP_SELF is a php's internal variable and gives the url's name. So with that you can always call the same form, where you just gives the command. Otherwise it will call index files. So your php form script is example.php which includes also the form and add buttom and so on. With that $PHP_SELF in action, you call the example.php again. And now the variable $insert="add". More information from internal variable you can find from php.net.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •