Form, folosind metoda POST care nu funcţionează


(Tudor) #1

Am făcut un sistem de înregistrare pt. site-ul meu. Problema e că form-ul nu funcţionează (am ajuns la această concluzie după multe ore de debugging). Pur şi simplu metoda POST nu funcţionează, variabilele ne primind nicio valoare, chiar dacă eu completez form-urile. Folosesc Bootstrap 4 (https://bootswatch.com - tema Cosmo - adică a doua).

        <form action="proceed.php?action=register" method="post">
            <div class="row">
                <div class="col-lg-6">
                    <div class="bs-component">
                        <fieldset>
                            <!-- Name form  -->
                            <div class="form-group">
                                <label for="Name">FULL NAME</label>
                                <input type="text" class="form-control" id="Name" value="<?php if(isset($_POST['Name'])) echo $_POST['Name'] ?>">
                            </div>

                            <!-- Username form  -->
                            <div class="form-group">
                                <label for="Username">USERNAME</label>
                                <input type="text" class="form-control" id="Username" value="<?php if(isset($_POST['Username'])) echo $_POST['Username']?>">
                            </div>

                            <!-- Email form  -->
                            <div class="form-group">
                                <label for="Email">EMAIL</label>
                                <input type="text" class="form-control" id="Email" value="<?php if(isset($_POST['Email'])) echo $_POST['Email'] ?>">
                            </div>
                        </fieldset>
                    </div>
                </div>

                <div class="col-lg-6">
                    <div class="bs-component">
                        <fieldset>
                            <!-- Gender form  -->
                            <div class="form-group">
                                <label for="Gender">SELECT GENDER</label>
                                <select class="form-control" id="Gender" value="<?php if(isset($_POST['Gender'])) echo $_POST['Gender'] ?>">
                                    <option value="nothing">Please select</option>
                                    <option value="Girl">Girl</option>
                                    <option value="Boy">Boy</option>
                                </select>
                            </div>

                            <!-- Password form  -->
                            <div class="form-group">
                                <label for="Password">PASSWORD</label>
                                <input type="password" class="form-control" id="Password" value="<?php if(isset($_POST['Password'])) echo $_POST['Password'] ?>">
                            </div>

                            <!-- Birth form  -->
                            <div class="form-group">
                                <label for="Birth">DATE OF BIRTH</label>
                                <input type="date" class="form-control" id="Birth">
                            </div>
                        </fieldset>
                    </div>
                </div>
            </div>

            <!-- Sign Up button  -->
            <button type="submit" class="btn btn-primary">Create Account</button>
        
        </form>

(Ionuț Staicu) #2
<input type="text" class="form-control" id="Name" value="<?php if(isset($_POST['Name'])) echo $_POST['Name'] ?>">

Asta pentru că nu specifici numele câmpurilor.

 <input name="Name">

S-ar putea să funcționeze mai bine.


(Tudor) #3

Acum funcţionează. Mulţumesc!