Learn PHP: GET and POST



Want more? Explore the library at

Official site

Twitter

Tag: post get php, posting php data, codecourse, beginners php, web development, GET, get and post, tutorials, POST, php, php forms, php basics, php form submitting, learn php, phpacademy

Xem thêm: https://meohay360.com/category/internet

Nguồn: https://meohay360.com

32 thoughts on “Learn PHP: GET and POST

  1. 2A ADDICT says:

    <?php
    if(isset($_POST['name'], $_POST['age'])) {
    $name = htmlentities($_POST['name'], ENT_QUOTES, 'UTF-8';
    $age = (int)$_POST['age'];

    echo "You are {$name} and you are {$age} years old.";
    }
    ?>

    <form action="index.php" method="post">
    <input type="text" name="name" placeholder="Name">
    <input type="text" name="age" placeholder="Age">
    <input type="submit">
    </form>

  2. 2A ADDICT says:

    <?php
    if(isset($_POST['name'], $_POST['age'])) {
    $name = htmlentities($_POST['name'], ENT_QUOTES, 'UTF-8';
    $age = $_POST['age'];

    echo "You are {$name} and you are {$age} years old.";
    }
    ?>

    <form action="index.php" method="post">
    <input type="text" name="name" placeholder="Name">
    <input type="text" name="age" placeholder="Age">
    <input type="submit">
    </form>

  3. 2A ADDICT says:

    <?php
    if(isset($_POST['name'], $_POST['age'])) {
    $name = $_POST['name'];
    $age = $_POST['age'];

    echo "You are {$name} and you are {$age} years old.";
    }
    ?>

    <form action="index.php" method="post">
    <input type="text" name="name" placeholder="Name">
    <input type="text" name="age" placeholder="Age">
    <input type="submit">
    </form>

  4. 2A ADDICT says:

    <?php
    if(isset($_POST['name'], $_POST['age'])) {
    echo 'Name and age are available';
    }
    ?>

    <form action="index.php" method="post">
    <input type="text" name="name" placeholder="Name">
    <input type="text" name="age" placeholder="Age">
    <input type="submit">
    </form>

  5. 2A ADDICT says:

    <?php
    if(isset($_POST['name'])) {
    echo 'OK';
    }
    ?>

    <form action="index.php" method="post">
    <input type="text" name="name" placeholder="Name">
    <input type="text" name="age" placeholder="Age">
    <input type="submit">
    </form>

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *