PHP From: POST, GET, REQUEST Method

Share Now

Share on facebook
Share on pinterest
Share on twitter
Share on linkedin
Share on email
<?php if(isset($_GET['fname']) && !empty($_GET['fname'])): ?>
    <b>First Name:</b> <?php echo $_GET['fname']; ?></br>
<?php endif; ?>

<?php if(isset($_GET['lname']) && !empty($_GET['lname'])): ?>
    <b>Last Name:</b> <?php echo $_GET['lname']; ?>
<?php endif; ?>
</p>

<!-- PHP POST METHOD -->
<p>
<?php if(isset($_POST['fname']) && !empty($_POST['fname'])): ?>
    <b>First Name:</b> <?php echo $_POST['fname']; ?></br>
<?php endif; ?>

<?php if(isset($_POST['lname']) && !empty($_POST['lname'])): ?>
    <b>Last Name:</b> <?php echo $_POST['lname']; ?>
<?php endif; ?>
</p>

<!-- PHP REQUEST METHOD -->
<p>
<?php if(isset($_REQUEST['fname']) && !empty($_REQUEST['fname'])): ?>
    <b>First Name:</b> <?php echo $_REQUEST['fname']; ?></br>
<?php endif; ?>

<?php if(isset($_REQUEST['lname']) && !empty($_REQUEST['lname'])): ?>
    <b>Last Name:</b> <?php echo $_REQUEST['lname']; ?>
<?php endif; ?>
</p>
Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert