Results 1 to 4 of 4

Thread: php method post

  1. #1
    Join Date
    Sep 2006
    Beans
    19

    php method post

    Hello,
    i got a problem with method post, i got a simple example:

    <?php $name = "John"; $age = 18;?>
    <form action="welcome.php" method="post">
    Enter your name: <input type="text" name="name" value="<?php echo $name;>"/>
    Enter your age: <input type="text" name="age" value="<?php echo $age;>" />
    <input type="submit" />
    </form>

    It seem's ok, but some browsers save information identified by names, if sometime you edit 'name' and 'age' inputs for example Luck 22. Later then you just open page can get inputs values not John 18, but Luck 22. How to avoid this situation? If remove attribute "name", would be ok, but how to get submited information. Maybe there some methods to get inputs information by id...

    Thanks.

  2. #2
    Join Date
    Apr 2007
    Beans
    14,781

    Re: php method post

    Use the ID attribute and the NAME attribute, and make them the same value.

    (Except for checkboxes, where the ID's have to be all different)

  3. #3
    Join Date
    Sep 2006
    Beans
    19

    Re: php method post

    i have found simple solution insert autocomplete="off" in form tag.

  4. #4
    Join Date
    May 2006
    Beans
    479

    Re: php method post

    Quote Originally Posted by carteris21 View Post
    i have found simple solution insert autocomplete="off" in form tag.
    It's not valid but it does work

Bookmarks

Posting Permissions

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