if($_SERVER["REQUEST_METHOD"] == "POST") { // Request current to get the input value $name = htmlspecialchars($_REQUEST['name']); echo "Hello, " . $name . "!"; }
$url = "https://example.com/my-page.php"; $url .= "?id=" . urlencode(5); $url .= "&name=" . urlencode("John"); echo $url;In this code example, we are using Request current to construct a URL by adding query parameters to it. We are encoding the values for safety. The PHP Request current method is part of the PHP core library and does not require any special package or library to be used.