Chuyên mục
Internet

Learn PHP: GET and POST

Rate this 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 trả lời trong “Learn PHP: GET and POST”

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

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

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

Trả lời

Email của bạn sẽ không được hiển thị công khai.