The secret to wholesale...

In the article about buying Thai goods, I introduced wholesale markets and cheap...

Restaurant business and the...

Customers are a special figure in restaurants. This may seem obvious, but...

Guide the clues to...

Japanese goods Known for putting quality first. However, in the past, due...

Online cosmetics business and...

Starting a business, especially online cosmetics business is the silver trend and...
HomeLập trìnhPhpTôi cần trợ...

Tôi cần trợ giúp về xác thực biểu mẫu bằng php


Chào mọi người,
Tôi đang cố xác thực biểu mẫu bằng PHP lần đầu tiên và gặp một số vấn đề.
Khi tôi gửi biểu mẫu, nó không xác thực nó và chuyển sang một trang khác hiển thị lỗi cấm truy cập.
Không hiểu mã php của tôi sai hay cài đặt tệp trên máy chủ cục bộ (XAMPP).
Tôi thực sự sẽ đánh giá cao nếu ai đó có thể giúp tôi. vui lòng kiểm tra bên dưới mã của tệp form.php và index.php:
tập tin form.php-

chỉ mục.php:

Mẫu đơn

<section id="contact" class="text-center padding">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h2>Contact</h2>
            </div>
        </div>
        <!--contact form section-->
        
        <div class="row">
            <div class="col-md-12">
               <form id="contactForm" class="form-horizontal" method="post" action="<?php echo htmlspecialchars ($SERVER['PHP_SELF']); ?>">
                    <div class="form-group has-success">
                        <label for="name"></label>
                        <div class="col-sm-10">
                            <input type="text" name="fname" value="<?= $fname ?>" class="form-control input-lg" id="name" placeholder="Name" required>
                            <span class="form-error" id="name-error"></span>
                            <span class="form-error"> <?= $nameErr ?></span>
                        </div>
                    </div>
                    <div class="form-group has-success">
                        <label for="email"></label>
                        <div class="col-sm-10">
                            <input type="email" name="email"  value="<?= $email ?>"class="form-control input-lg" id="email" placeholder="Email" required>
                            <span class="form-error" id="email-error"></span>
                            <span class="form-error"> <?= $emailErr ?></span>
                        </div>
                    </div>
                    <div class="form-group has-success">
                        <label for="message"></label>
                        <div class="col-sm-10">
                            <textarea id="message" name="message" value="<?= $message ?>" class="form-control input-lg" rows="5" placeholder="Message" required></textarea>
                            <span class="form-error" id="message-error"></span>
                            <span class="form-error"> <?= $messageErr ?></span>

                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-sm-10">
                            <button type="submit"  name="submit" id="button_submit" class="btn btn-primary pull-right">Send</button>
                            <button type="reset" id="button_reset" class="btn btn-primary pull-right">Reset</button>
                        </div>
                    </div>
                    <div id="contactResponse"></div>
                 <div>   <?= $success; ?></div>
                </form>
            </div>
        </div>
        <!--contact form section ends here-->
    </div>
</section>




Zik.vn – Biên dịch & Biên soạn Lại

Đọc thêm  Công việc học lập trình Php - Diễn đàn freeCodeCamp
spot_img

Create a website from scratch

Just drag and drop elements in a page to get started with Newspaper Theme.

Buy Now ⟶

Bài viết liên quang

DMCA.com Protection Status