Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP Superglobal - $_REQUEST

<html>
<body>

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  Name: <input type="text" name="fname">
  <input type="submit">
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
  // collect value of input field
  $name = $_REQUEST['fname'];
  if (empty($name)) {
    echo "Name is empty";
  } else {
    echo $name;
  }
}
?>

</body>
Comment

PHP Superglobal - $_POST

<html>
<body>

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  Name: <input type="text" name="fname">
  <input type="submit">
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
  // collect value of input field
  $name = $_POST['fname'];
  if (empty($name)) {
    echo "Name is empty";
  } else {
    echo $name;
  }
}
?>

</body>
</html>
Comment

PHP Superglobal - $_GET

<html>
<body>

<?php
echo "Study " . $_GET['subject'] . " at " . $_GET['web'];
?>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: select query with multiple where clause in php 
Php :: WordPress Emojis abschalten 
Php :: Laravel: Session message exist while click on browser back button 
Php :: laravel view 
Php :: connexion sql php/html 
Php :: var_dump-type and value of expresion 
Php :: laravel post index method 
Php :: lazy loading vs eager loading laravel 
Php :: Save data from route 
Php :: auto complete order paid1 
Php :: Comment supprimer les onglets WooCommerce dans WordPress 
Php :: php like button counter 
Php :: desactivar estilos globales wordpress 5.9 
Php :: why php $_session in not working in react js 
Php :: php check if weekends 
Php :: avoid data insertion if an error occurs in laravel 
Php :: Writing into the database with one click laravel 
Php :: Multiple databases user validation in Laravel 
Php :: carbon parse 
Php :: cách nhúng php vào html 
Php :: Undefined property: CI::$file 
Php :: mod_fcgid: stderr: PHP Fatal error: Maximum execution time of 0 seconds exceeded in /home/circusconcepts/public_html/shop/system/library/PHPExcel/Shared/String.php on line 576 
Php :: symmetric decryption in php 
Php :: Store Notice 
Php :: Laravel array to string error 
Php :: Remove images from the the_content() 
Php :: wordpress get_permalink not working 
Php :: alphabet, link, range 
Php :: how get database structure in laravel 
Php :: Target class [HomeController] does not exist. 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =