text: Remember when you FIRST enter the page, there is no such thing about the variable $do since $_POST array does not exist!\n\nI see multiple problems over there.\n- Your form has the method of POST, so why do you use GET  ?\n +  $do=$_GET['do'];  should be $do=$_POST['do'];\n- Now since the variable do does not exist you could do a simple if statement that checks that. The function isset checks if that variable exists.\n + $do = isset($_POST['do']) ? 'send'  : 'ok';\n- But there is another problem, The hidden name for do does not exist.. So lets change it to do\n + <input type="hidden" name="do" value="ok">\n\n[now the overall code]\n=============================\n<html>\n<body>\n<?php\n\n// Lets initialize the variable\n$do = isset($_POST['do']) ? 'send'  : 'ok';\n\n// Lets just display the current Action\necho 'ACTION:'.$do;\n\n// Check if the hidden variable was sent\nif ($do == 'send') {\n\n // Lets print out the post array\n var_dump($_POST);\n\n} else { ?>\n <form method="POST" action="">\n <p><input type="submit" value="Submit" name="submit"></p>\n <input type="hidden" name="do" value="ok">\n </form>\n<?php } ?>\n</body>\n</html>\n=============================\nI took out the other forms...\n\nThe above should work.. Now.. But why introduce another variable if you already have the submit variable intact? What you could do is say $do = isset($_POST['submit']) ? 'send'  : 'Submit'; That will remove that hidden field. Another thing I realize is that your mixing HTML code with PHP code which is BAD PRACTICE. I recommend you to at least separate them, or if you don't want to use a templating engine, I recommend you do at least store the output in one variable like outvar = "". That will take out alot of issues in the future.\n\nAnyways.. Good Luck