0

I have a strange problem. The GET parameters will not passed.

<!DOCTYPE html>
<html>
    <body>
        <?php
        var_dump($_GET);
        var_dump($_POST);
        ?>
        <form action="test.php?ds=1" method="GET">
                    <input type="text">
                    <input type="submit">
                </form>
    </body>
</html>

If the method is 'GET' the form jumps to 'test.php' without params. Not even to 'test.php?ds=1'... Nothing will be passed. If i change the method to 'POST' will the form jump to 'test.php?ds=1' but still passes no input.

Tim
  • 143
  • 2
  • 12

1 Answers1

2

First, you need to give your input a name in order to be passed. Best would be to change to "POST" and add "ds" as hidden input.

<form action="test.php" method="POST">
    <input type="text" name="foo">
    <input type="submit">
    <input type="hidden" name="ds" value="1">
</form>
jlocker
  • 1,478
  • 1
  • 12
  • 23
minychillo
  • 395
  • 4
  • 17