Courses Job Ready Fresher Training AI for Class 7 to 12 Corporate Training Placements Tutorials
Free Learning Resources

IT Tutorials & Interview Prep

Free guides, interview Q&As, and job responsibility breakdowns — curated by industry veterans to help you crack MNC interviews

109+
Tutorial Articles
9
Topic Categories
100%
Free to Read
← Back to PHP

$_POST

PHP Last Updated: Oct 17, 2025

$_POST

The PHP $_POST is a PHP superglobal which is used to collect form data after submitting an HTML form using method="post". In the following example, we will use the $_POST superglobal to collect a value.

htmlentities() Function: The htmlentities() function is an inbuilt function that is used to transform all characters which are applicable to HTML entities.

Example:

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
   $name = htmlspecialchars($_REQUEST['fname']); // Collecting Value
   if (empty($name)) {
       echo "Empty Name";
   } else {
       echo $name;
   }
}
?>

Want to practice these scenarios in a real IT environment? Our 45-Day Internship Program gives you hands-on experience with Active Directory, Ticketing Tools, and Networking.
Join the Internship →