<html> <body> <form name="formularz" action="#" method="post"> <input type="text" name="t" value="tekst" /> <input type="hidden" name="h" value="ukryte" /> <input type="password" name="p" value="hasło" /> <button type="submit">Wyślij</button> </form> <?php if(isset($_POST['t']) && isset($_POST['h']) && isset($_post['p'])) { $t = (isset($_POST['t'])? $_POST['t']: ''); $h = (isset($_POST['h'])? $_POST['h']: ''); $p = (isset($_POST['p'])? $_POST['p']: ''); echo "<p>text=$t, hidden=$h, password=$p", '</p>'; } ?> </body> </html>
The code above should create a form and then display it via a php script. This is a 1:1 copy of my teacher resource that other students can use. The class collectively called it the same, and the mystery of its eventual failure remains unsolved to this day.
There is no error warning, the script just doesn't display anything after submitting the form. please help me.
Your condition is wrong. The last method isset is $_post in lowercase and should be like this: if(isset($_POST['t']) && isset($_POST['h']) && isset ($ _POST['p']))