PHP does not echo form data stored in variables
P粉078945182
P粉078945182 2024-04-02 18:59:32
0
1
490

<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.

P粉078945182
P粉078945182

reply all(1)
P粉322319601

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']))

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template